C++ Library Extensions 2022.12.09
To help learn modern C++ programming
23-first_n_types.cpp
Go to the documentation of this file.
1#include <tpf_output.hpp>
2
3namespace types = tpf::types;
4
7
9{
11
17
18 stream <<"t0 = " << Tpf_GetTypeName(t0) << endl;
19 stream <<"t1 = " << Tpf_GetTypeName(t1) << endl;
20 stream <<"t2 = " << Tpf_GetTypeName(t2) << endl;
21 stream <<"t3 = " << Tpf_GetTypeName(t3) << endl;
22 stream <<"t4 = " << Tpf_GetTypeName(t4) << endl;
23}
24
26{
28
34
35 stream <<"t0 = " << Tpf_GetTypeName(t0) << endl;
36 stream <<"t1 = " << Tpf_GetTypeName(t1) << endl;
37 stream <<"t2 = " << Tpf_GetTypeName(t2) << endl;
38 stream <<"t3 = " << Tpf_GetTypeName(t3) << endl;
39 stream <<"t4 = " << Tpf_GetTypeName(t4) << endl;
40}
41
43{
45 stream << "t0 = " << t0{} << endl;
46
48 stream << "t1 = " << t1{} << endl;
49
51 stream << "t2 = " << t2{} << endl;
52
54 stream << "t3 = " << t3{} << endl;
55
57 stream << "t4 = " << t4{} << endl;
58
59}
60
62{
64
66 stream << "t0 = " << t0{} << endl;
67
69 stream << "t1 = " << t1{} << endl;
70
72 stream << "t2 = " << t2{} << endl;
73
75 stream << "t3 = " << t3{} << endl;
76
78 stream << "t4 = " << t4{} << endl;
79}
80
81
83{
85
86 stream << Tpf_GetTypeName(type_t) << endl;
87}
88
90{
91 using tuple_t = std::tuple<>;
92
94 stream <<"t0 = " << Tpf_GetTypeName(t0) << endl;
95
97 stream <<"t1 = " << Tpf_GetTypeName(t1) << endl;
98
100
102 stream <<"t2 = " << Tpf_GetTypeName(t2) << endl;
103
104 //using t3 = types::nth_type_to_template_class_t<3, tuple_t, types_t>;
105 //stream <<"t3 = " << Tpf_GetTypeName(t3) << endl;
106}
107
109{
110 using tuple_t = std::tuple<>;
111
113 stream <<"t0 = " << Tpf_GetTypeName(t0) << endl;
114
116 stream <<"t1 = " << Tpf_GetTypeName(t1) << endl;
117
119
121 stream <<"t2 = " << Tpf_GetTypeName(t2) << endl;
122
124 stream <<"t3 = " << Tpf_GetTypeName(t3) << endl;
125
126 // using t4 = types::first_n_types_to_template_class_t<4, tuple_t, types_t>;
127 // stream <<"t4 = " << Tpf_GetTypeName(t4) << endl;
128
129
130 //using t3 = types::nth_type_to_template_class_t<3, tuple_t, types_t>;
131 //stream <<"t3 = " << Tpf_GetTypeName(t3) << endl;
132}
133
134int main()
135{
136 // test_first_n_types_t();
137
138 // test_first_n_types_t2();
139
140 // test_last_n_types_1();
141
142 // test_last_n_types_2();
143
144 // test_is_class_template();
145
146 // test_nth_type_to_template_class();
147
149}
void test_first_n_types_t2()
tpf::sstream stream
void test_last_n_types_1()
void test_first_n_types_to_template_class()
void test_last_n_types_2()
void test_first_n_types_t()
auto endl
void test_is_class_template()
int main()
void test_nth_type_to_template_class()
Type to string name conversions are defined.
Definition: 31-visit.cpp:7
hidden::last_n_types_t< LastN, Types... > last_n_types_t
Definition: tpf_types.hpp:5618
hidden::nth_type_to_template_class_t< SelectTypeIndex, TemplateClass, Types... > nth_type_to_template_class_t
Definition: tpf_types.hpp:6987
hidden::types_to_template_class_t< Type, Types... > types_to_template_class_t
Definition: tpf_types.hpp:6980
hidden::first_n_types_t< FirstN, Types... > first_n_types_t
Definition: tpf_types.hpp:5612
hidden::first_n_types_to_template_class_t< FirstN, TemplateClass, Types... > first_n_types_to_template_class_t
Definition: tpf_types.hpp:6991
constexpr auto endl
Definition: tpf_output.hpp:973
This type is used to manipulate type list.
Definition: tpf_types.hpp:956
Stream output operators << are implemented.
#define Tpf_GetTypeName(type_arg)
A macro that returns type_arg's string name.
Definition: tpf_types.hpp:1422