Advertisement
Guest User

Untitled

a guest
Oct 21st, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <tuple>
  4. #include <vector>
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. vector< tuple< int, string > > data;
  10.  
  11. for( int idx = 0; idx < 10; idx++ )
  12. {
  13. tuple< int, string > tmp;
  14. ::get< 0 >( tmp ) = idx;
  15. ::get< 1 >( tmp ) = "test" + ::to_string( idx );
  16. data.push_back( tmp );
  17. }
  18. for( int idx = 0; idx < 10; idx++ )
  19. {
  20. cout << ::get< 0 >( data[ idx ] ) << ", " << ::get< 1 >( data[ idx ] ) << endl;
  21. }
  22.  
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement