Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.