C++ Library Extensions 2022.12.09
To help learn modern C++ programming
006-is_integer_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 cout << std::boolalpha;
21
22 cout <<"Is [char] an integer: " << types::is_integer_v<char> << " <--------" << nl;
23 cout <<"Is [int] an integer: " << types::is_integer_v<int> << nl;
24 cout <<"Is [bool] an integer: " << types::is_integer_v<bool> << " <--------" << nl;
25 cout <<"Is [double] an integer: " << types::is_integer_v<double> << nl;
26 cout <<"Is [long long] an integer: " << types::is_integer_v<long long> << nl;
27
28 cout <<"Is [short] signed: " << types::is_signed_integer_v<short> << nl;
29 cout <<"Is [unsigned short] signed: " << types::is_signed_integer_v<unsigned short> << nl;
30
31 cout <<"Is [int] signed: " << types::is_signed_integer_v<int> << nl;
32 cout <<"Is [unsigned int] signed: " << types::is_signed_integer_v<unsigned int> << nl;
33
34 cout << "Is [double] signed: " << types::is_signed_integer_v<double> << nl;
35 cout << "Is [float] signed: " << types::is_signed_integer_v<float> << nl;
36
37 cout <<"Is [short] unsigned: " << types::is_unsigned_integer_v<short> << nl;
38 cout <<"Is [unsigned short] unsigned: " << types::is_unsigned_integer_v<unsigned short> << nl;
39
40 cout <<"Is [int] unsigned: " << types::is_unsigned_integer_v<int> << nl;
41 cout <<"Is [unsigned int] unsigned: " << types::is_unsigned_integer_v<unsigned int> << nl;
42
43 cout << "Is [double] unsigned: " << types::is_unsigned_integer_v<double> << " <--------" << nl;
44 cout << "Is [float] unsigned: " << types::is_unsigned_integer_v<float> << " <--------" << nl;
45}
46
48{
49 namespace types = tpf::types;
50 auto& cout = std::cout;
51 auto nl = "\n";
52 cout << std::boolalpha;
53
54 cout <<"Is [char] an integral type: " << types::is_integral_v<char> << " <--------" << nl;
55 cout <<"Is [int] an integral type: " << types::is_integral_v<int> << nl;
56 cout <<"Is [bool] an integral type: " << types::is_integral_v<bool> << " <--------" << nl;
57 cout <<"Is [double] an integral type: " << types::is_integral_v<double> << nl;
58 cout <<"Is [long long] an integral type: " << types::is_integral_v<long long> << nl;
59
60 cout <<"Is [short] signed integral type: " << types::is_signed_integral_v<short> << nl;
61 cout <<"Is [unsigned short] signed integral type: " << types::is_signed_integral_v<unsigned short> << nl;
62
63 cout <<"Is [int] signed integral type: " << types::is_signed_integral_v<int> << nl;
64 cout <<"Is [unsigned int] signed integral type: " << types::is_signed_integral_v<unsigned int> << nl;
65
66 cout << "Is [double] signed integral type: " << types::is_signed_integral_v<double> << nl;
67 cout << "Is [float] signed integral type: " << types::is_signed_integral_v<float> << nl;
68
69 cout <<"Is [short] unsigned integral type: " << types::is_unsigned_integral_v<short> << nl;
70 cout <<"Is [unsigned short] unsigned integral type: " << types::is_unsigned_integral_v<unsigned short> << nl;
71
72 cout <<"Is [int] unsigned integral type: " << types::is_unsigned_integral_v<int> << nl;
73 cout <<"Is [unsigned int] unsigned integral type: " << types::is_unsigned_integral_v<unsigned int> << nl;
74
75 cout << "Is [double] unsigned integral type: " << types::is_unsigned_integral_v<double> << " <--------" << nl;
76 cout << "Is [float] unsigned integral type: " << types::is_unsigned_integral_v<float> << " <--------" << nl;
77}
78
79
80int main()
81{
83
85
87}
void examples_is_integral_v()
void examples_is_integer_v()
int main()
auto nl
auto & cout
auto & endl
Type to string name conversions are defined.
Definition: 31-visit.cpp:7
Type functions are implemented.