-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTypeInformationTabularForm.cpp
More file actions
59 lines (52 loc) · 2.25 KB
/
Copy pathTypeInformationTabularForm.cpp
File metadata and controls
59 lines (52 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// TypeInformationTabularForm by Ulrich Eisenecker, August 12,i 2024
#include <cstddef> // because of std::nullptr_t
#include <iomanip> // because of setw()
#include <iostream>
#include <type_traits> // because of is_arithmeti_vc_v<>, is_integral_V<>,
// is_unsigned_v_v<>, is_signed_v_v<>,
// is_floating_point_v_v<>
using namespace std;
void printLine()
{
cout << "--------------------+----------+----------+----------+----------+----------\n";
}
int main()
{
cout << boolalpha << endl;
cout << " | bool | char | int | double | nullptr_t \n";
printLine();
cout << setw(19) << "is_arithmetic_v" << " | "
<< setw(8) << is_arithmetic_v<bool> << " | "
<< setw(8) << is_arithmetic_v<char> << " | "
<< setw(8) << is_arithmetic_v<int> << " | "
<< setw(8) << is_arithmetic_v<double> << " | "
<< setw(9) << is_arithmetic_v<nullptr_t> << endl;
printLine();
cout << setw(19) << "is_integral_v" << " | "
<< setw(8) << is_integral_v<bool> << " | "
<< setw(8) << is_integral_v<char> << " | "
<< setw(8) << is_integral_v<int> << " | "
<< setw(8) << is_integral_v<double> << " | "
<< setw(9) << is_integral_v<nullptr_t> << endl;
printLine();
cout << setw(19) << "is_unsigned_v" << " | "
<< setw(8) << is_unsigned_v<bool> << " | "
<< setw(8) << is_unsigned_v<char> << " | "
<< setw(8) << is_unsigned_v<int> << " | "
<< setw(8) << is_unsigned_v<double> << " | "
<< setw(9) << is_unsigned_v<nullptr_t> << endl;
printLine();
cout << setw(19) << "is_signed_v" << " | "
<< setw(8) << is_signed_v<bool> << " | "
<< setw(8) << is_signed_v<char> << " | "
<< setw(8) << is_signed_v<int> << " | "
<< setw(8) << is_signed_v<double> << " | "
<< setw(9) << is_signed_v<nullptr_t> << endl;
printLine();
cout << setw(19) << "is_floating_point_v" << " | "
<< setw(8) << is_floating_point_v<bool> << " | "
<< setw(8) << is_floating_point_v<char> << " | "
<< setw(8) << is_floating_point_v<int> << " | "
<< setw(8) << is_floating_point_v<double> << " | "
<< setw(9) << is_floating_point_v<nullptr_t> << endl;
}