Skip to content

Instantly share code, notes, and snippets.

@cedriclmenard
Created August 7, 2020 02:22
Show Gist options
  • Save cedriclmenard/37d6c9baa236c326850b81f1bda2483e to your computer and use it in GitHub Desktop.
Save cedriclmenard/37d6c9baa236c326850b81f1bda2483e to your computer and use it in GitHub Desktop.
Structured Binding C++ tuple
#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