get elements of tuple c 2b 2b

Solutions on MaxInterview for get elements of tuple c 2b 2b by the best coders in the world

showing results for - "get elements of tuple c 2b 2b"
Anastasia
14 Apr 2018
1#include <tuple>
2#include <iostream>
3int main()
4{
5    auto t = std::make_tuple(1, "Foo", 3.14);
6    // index-based access
7    std::cout << "(" << std::get<0>(t) << ", " << std::get<1>(t)
8              << ", " << std::get<2>(t) << ")\n";
9}