Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <tuple>
- #include <vector>
- using namespace std;
- int main()
- {
- vector< tuple< int, string > > data;
- for( int idx = 0; idx < 10; idx++ )
- {
- tuple< int, string > tmp;
- ::get< 0 >( tmp ) = idx;
- ::get< 1 >( tmp ) = "test" + ::to_string( idx );
- data.push_back( tmp );
- }
- for( int idx = 0; idx < 10; idx++ )
- {
- cout << ::get< 0 >( data[ idx ] ) << ", " << ::get< 1 >( data[ idx ] ) << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement