function template
<tuple>
std::tuple_cattemplate <class... Tuples> tuple<CTypes...> tuple_cat (Tuples&&... tpls);
Concatenate tuples
Constructs an object of the appropriate tuple type to contain a concatenation of the elements of all the tuples in tpls, in the same order.Each element in the returned tuple is copy/move constructed (as if passed with forward).
The type of the returned object (tuple<CTypes...>
) is the tuple type that contains the ordered sequence of all the extended types in Tuples.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// tuple_cat example
#include <iostream> // std::cout
#include <utility> // std::pair
#include <string> // std::string
#include <tuple> // std::tuple, std::tuple_cat, std::get
int main ()
{
std::tuple<float,std::string> mytuple (3.14,"pi");
std::pair<int,char> mypair (10,'a');
auto myauto = std::tuple_cat ( mytuple, std::tuple<int,char>(mypair) );
std::cout << "myauto contains: " << '\n';
std::cout << std::get<0>(myauto) << '\n';
std::cout << std::get<1>(myauto) << '\n';
std::cout << std::get<2>(myauto) << '\n';
std::cout << std::get<3>(myauto) << '\n';
return 0;
}
myauto contains: 3.14 pi 10 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