Horje
get first element of tuple c++ Code Example
get first element of tuple c++
#include <iostream>
#include <string>
#include <tuple>
 
auto t = std::make_tuple(1, "Foo", 3.14);
// index-based access
std::cout << "(" << std::get<0>(t) << ", " << std::get<1>(t)<< ", " << std::get<2>(t) << ")\n";
// type-based access (C++14 or later)
std::cout << "(" << std::get<int>(t) << ", " << std::get<const char*>(t) << ", " << std::get<double>(t) << ")\n";




Cpp

Related
typedef vector c++ Code Example typedef vector c++ Code Example
how to convert int to string c++ Code Example how to convert int to string c++ Code Example
helloworld  in c++ Code Example helloworld in c++ Code Example
c++ char to uppercase Code Example c++ char to uppercase Code Example
easy c++ code Code Example easy c++ code Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10