finished product

This commit is contained in:
Stephen M. McQuay
2012-05-05 13:45:49 -06:00
parent db5f9714a5
commit 815175e35e
5 changed files with 14 additions and 8 deletions
+8 -3
View File
@@ -3,16 +3,21 @@
using namespace std;
// make a function that returns multiple values
auto some_func() -> tuple<int, int> {
return make_tuple(4, 2);
}
int main() {
tuple<int, int> c = make_tuple(5, 4);
auto c = make_tuple(5, 4);
cout << get<0>(c) << endl;
int a = 0;
int b = 1;
tie(a, b) = make_tuple(b, a);
cout << a << endl;
cout << b << endl;
// swap a, b
// get a,b from func ...
tie(a, b) = some_func();
cout << a << endl;
cout << b << endl;
}