C++ Library Extensions 2022.12.09
To help learn modern C++ programming
005-is_in_list_v.cpp
Go to the documentation of this file.
1
12#include <iostream>
13#include <tpf_types.hpp>
14
16{
17 namespace types = tpf::types;
18 auto& cout = std::cout;
19 auto nl = "\n";
20
21 cout << std::boolalpha;
22
23 cout << "Is int in <>: "
24 << types::is_in_list_v<int> << nl;
25
26 cout << "Is int in <int>: "
27 << types::is_in_list_v<int, int> << nl;
28
29 cout << "Is int in <short>: "
30 << types::is_in_list_v<int, short> << nl;
31
32 cout << "Is char in <short, int, double>: "
33 << types::is_in_list_v<char, short, int, double> << nl;
34
35 cout << "Is int in <short, int, double>: "
36 << types::is_in_list_v<int, short, int, double> << nl;
37
38 using typelist1_t = types::type_list_t<>;
39 cout << "Is int in <>: " << types::is_in_list_v<int, typelist1_t> << nl;
40
41 using typelist2_t = types::type_list_t<int>;
42 cout << "Is int in <int>: " << types::is_in_list_v<int, typelist2_t> << nl;
43
45 cout << "Is short in <int, float, double>: " << types::is_in_list_v<short, typelist3_t> << nl;
46
47 cout << "Is int in <int, float, double>: " << types::is_in_list_v<int, typelist3_t> << nl;
48
49 cout << "Is double in <int, float, double>: " << types::is_in_list_v<double, typelist3_t> << nl;
50
51
52}
53
54int main()
55{
57}
void example_is_in_list_v()
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.