C++ Library Extensions 2022.12.09
To help learn modern C++ programming
005-is_same_v.cpp
Go to the documentation of this file.
1
12#include <iostream>
13#include <tpf_types.hpp>
14
20{
21 namespace types = tpf::types;
22
23 auto& cout = std::cout;
24 auto nl = "\n";
25
26 cout << std::boolalpha;
27
28 using type1_t = int;
29 using type2_t = double;
30 using type3_t = short;
31
32 cout << "is_same_v<int>: "
33 << types::is_same_v<int> << nl;
34
35 cout << "is_same_v<int, int>: "
36 << types::is_same_v<int, int> << nl;
37
38 cout << "is_same_v<int, int, int>: "
39 << types::is_same_v<int, int, int> << nl;
40
41 cout << "is_same_v<int, short>: "
42 << types::is_same_v<int, short> << nl;
43
44 using typelist1_t = types::type_list_t<int>;
45 cout << "is_same_v< type_list_t<int> > : "
46 << types::is_same_v<typelist1_t> << nl;
47
48 using typelist2_t = types::type_list_t<int, int>;
49 cout << "is_same_v< type_list_t<int, int> > : "
50 << types::is_same_v<typelist2_t> << nl;
51
52 using typelist3_t = types::type_list_t<int, short>;
53 cout << "is_same_v< type_list_t<int, short> > : "
54 << types::is_same_v<typelist3_t> << nl;
55
56 using typelist4_t = types::type_list_t<int, int, int>;
57 cout << "is_same_v< type_list_t<int, int, int> > : "
58 << types::is_same_v<typelist4_t> << nl;
59
61 cout << "is_same_v< type_list_t<int, int, int, double> > : "
62 << types::is_same_v<typelist5_t> << nl;
63}
64
65int main()
66{
68}
void examples_is_same_v()
Examples for tpf::types::is_same_v<Type, Types...>
int main()
auto nl
auto & cout
Type to string name conversions are defined.
Definition: 31-visit.cpp:7
This type is used to manipulate type list.
Definition: tpf_types.hpp:956
Type functions are implemented.