Skip to content

Instantly share code, notes, and snippets.

@devramx
Created November 10, 2017 19:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devramx/a653a6833ceb4ef84c37b6cdd3f59563 to your computer and use it in GitHub Desktop.
Save devramx/a653a6833ceb4ef84c37b6cdd3f59563 to your computer and use it in GitHub Desktop.
Multiple return values from function ( < C++17 )
#include <tuple>
auto AnswerToEverything() -> std::tuple<int, int>
{
return std::make_tuple(42, 9001);
}
int a=0, b=0;
std::tie(a,b) = AnswerToEverything();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment