Created
August 7, 2020 02:22
-
-
Save cedriclmenard/37d6c9baa236c326850b81f1bda2483e to your computer and use it in GitHub Desktop.
Structured Binding C++ tuple
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <tuple> | |
using namespace std; | |
tuple<int, float, string> foo() | |
{ | |
return {128, 3.142, "Hello"}; | |
} | |
int main() | |
{ | |
auto [value1, value2, value3] = foo(); | |
cout << value1 << ", " << value2 << ", " << value3 << endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment