class template
<tuple>
std::tuple_element unspecializedtemplate <size_t I, class T> class tuple_element;generic cv-specializations
template <size_t I, class T> class tuple_element<const T>;template <size_t I, class T> class tuple_element<volatile T>;template <size_t I, class T> class tuple_element<const volatile T>;tuple specialization
template <size_t I, class... Types> class tuple_element< I, tuple<Types...> >;
Tuple element type
Class designed to access the type of the Ith element in a tuple.It is a simple class with a single member type, tuple_element::type, defined as an alias of the type of the Ith element in a tuple of type T.
The class is itself undefined for the generic type T, but it is specialized for tuple instantiations in the <tuple>
header, and for tuple-like types array and pair in their respective headers.
For const
and/or volatile
-qualified tuples, the class is specialized so that its type member has itself that same qualification.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// tuple_element
#include <iostream> // std::cout
#include <tuple> // std::tuple, std::make_tuple, std::tuple_element, std::get
int main ()
{
auto mytuple = std::make_tuple (10,'a');
std::tuple_element<0,decltype(mytuple)>::type first = std::get<0>(mytuple);
std::tuple_element<1,decltype(mytuple)>::type second = std::get<1>(mytuple);
std::cout << "mytuple contains: " << first << " and " << second << '\n';
return 0;
}
mytuple contains: 10 and a
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4