mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-05 14:27:51 +02:00
[C++/en] Tuples in C++
This commit is contained in:
@@ -966,11 +966,10 @@ v.swap(vector<Foo>());
|
|||||||
// its elements are accessed by their order in the tuple.
|
// its elements are accessed by their order in the tuple.
|
||||||
|
|
||||||
// We start with constructing a tuple.
|
// We start with constructing a tuple.
|
||||||
//
|
|
||||||
// Packing values into tuple
|
// Packing values into tuple
|
||||||
auto first = make_tuple( 10 , 'A' ) ;
|
auto first = make_tuple( 10 , 'A' ) ;
|
||||||
const int maxN = 1e9;
|
const int maxN = 1e9;
|
||||||
int maxL = 15;
|
const int maxL = 15;
|
||||||
auto second = make_tuple( maxN , maxL ) ;
|
auto second = make_tuple( maxN , maxL ) ;
|
||||||
|
|
||||||
// printing elements of 'first' tuple
|
// printing elements of 'first' tuple
|
||||||
|
Reference in New Issue
Block a user