@@ -32,6 +32,12 @@ TEST_CASE("Polyfills/type_traits") {
32
32
SECTION (" is_integral" ) {
33
33
CHECK (is_integral<double >::value == false );
34
34
CHECK (is_integral<float >::value == false );
35
+ CHECK (is_integral<const double >::value == false );
36
+ CHECK (is_integral<const float >::value == false );
37
+ CHECK (is_integral<volatile double >::value == false );
38
+ CHECK (is_integral<volatile float >::value == false );
39
+ CHECK (is_integral<const volatile double >::value == false );
40
+ CHECK (is_integral<const volatile float >::value == false );
35
41
36
42
CHECK (is_integral<bool >::value == true );
37
43
CHECK (is_integral<char >::value == true );
@@ -43,6 +49,36 @@ TEST_CASE("Polyfills/type_traits") {
43
49
CHECK (is_integral<unsigned int >::value == true );
44
50
CHECK (is_integral<unsigned long >::value == true );
45
51
CHECK (is_integral<unsigned short >::value == true );
52
+ CHECK (is_integral<const bool >::value == true );
53
+ CHECK (is_integral<const char >::value == true );
54
+ CHECK (is_integral<const signed char >::value == true );
55
+ CHECK (is_integral<const signed int >::value == true );
56
+ CHECK (is_integral<const signed long >::value == true );
57
+ CHECK (is_integral<const signed short >::value == true );
58
+ CHECK (is_integral<const unsigned char >::value == true );
59
+ CHECK (is_integral<const unsigned int >::value == true );
60
+ CHECK (is_integral<const unsigned long >::value == true );
61
+ CHECK (is_integral<const unsigned short >::value == true );
62
+ CHECK (is_integral<volatile bool >::value == true );
63
+ CHECK (is_integral<volatile char >::value == true );
64
+ CHECK (is_integral<volatile signed char >::value == true );
65
+ CHECK (is_integral<volatile signed int >::value == true );
66
+ CHECK (is_integral<volatile signed long >::value == true );
67
+ CHECK (is_integral<volatile signed short >::value == true );
68
+ CHECK (is_integral<volatile unsigned char >::value == true );
69
+ CHECK (is_integral<volatile unsigned int >::value == true );
70
+ CHECK (is_integral<volatile unsigned long >::value == true );
71
+ CHECK (is_integral<volatile unsigned short >::value == true );
72
+ CHECK (is_integral<const volatile bool >::value == true );
73
+ CHECK (is_integral<const volatile char >::value == true );
74
+ CHECK (is_integral<const volatile signed char >::value == true );
75
+ CHECK (is_integral<const volatile signed int >::value == true );
76
+ CHECK (is_integral<const volatile signed long >::value == true );
77
+ CHECK (is_integral<const volatile signed short >::value == true );
78
+ CHECK (is_integral<const volatile unsigned char >::value == true );
79
+ CHECK (is_integral<const volatile unsigned int >::value == true );
80
+ CHECK (is_integral<const volatile unsigned long >::value == true );
81
+ CHECK (is_integral<const volatile unsigned short >::value == true );
46
82
47
83
CHECK (is_integral<UInt>::value == true );
48
84
}
@@ -56,6 +92,33 @@ TEST_CASE("Polyfills/type_traits") {
56
92
CHECK (is_signed<float >::value == true );
57
93
CHECK (is_signed<double >::value == true );
58
94
CHECK (is_signed<bool >::value == false );
95
+
96
+ CHECK (is_signed<const char >::value == true );
97
+ CHECK (is_signed<const signed char >::value == true );
98
+ CHECK (is_signed<const signed int >::value == true );
99
+ CHECK (is_signed<const signed short >::value == true );
100
+ CHECK (is_signed<const signed long >::value == true );
101
+ CHECK (is_signed<const float >::value == true );
102
+ CHECK (is_signed<const double >::value == true );
103
+ CHECK (is_signed<const bool >::value == false );
104
+
105
+ CHECK (is_signed<volatile char >::value == true );
106
+ CHECK (is_signed<volatile signed char >::value == true );
107
+ CHECK (is_signed<volatile signed int >::value == true );
108
+ CHECK (is_signed<volatile signed short >::value == true );
109
+ CHECK (is_signed<volatile signed long >::value == true );
110
+ CHECK (is_signed<volatile float >::value == true );
111
+ CHECK (is_signed<volatile double >::value == true );
112
+ CHECK (is_signed<volatile bool >::value == false );
113
+
114
+ CHECK (is_signed<const volatile char >::value == true );
115
+ CHECK (is_signed<const volatile signed char >::value == true );
116
+ CHECK (is_signed<const volatile signed int >::value == true );
117
+ CHECK (is_signed<const volatile signed short >::value == true );
118
+ CHECK (is_signed<const volatile signed long >::value == true );
119
+ CHECK (is_signed<const volatile float >::value == true );
120
+ CHECK (is_signed<const volatile double >::value == true );
121
+ CHECK (is_signed<const volatile bool >::value == false );
59
122
}
60
123
61
124
SECTION (" is_unsigned" ) {
@@ -67,6 +130,45 @@ TEST_CASE("Polyfills/type_traits") {
67
130
CHECK (is_unsigned<char >::value == false );
68
131
CHECK (is_unsigned<float >::value == false );
69
132
CHECK (is_unsigned<double >::value == false );
133
+
134
+ CHECK (is_unsigned<const unsigned char >::value == true );
135
+ CHECK (is_unsigned<const unsigned int >::value == true );
136
+ CHECK (is_unsigned<const unsigned short >::value == true );
137
+ CHECK (is_unsigned<const unsigned long >::value == true );
138
+ CHECK (is_unsigned<const bool >::value == true );
139
+ CHECK (is_unsigned<const char >::value == false );
140
+ CHECK (is_unsigned<const float >::value == false );
141
+ CHECK (is_unsigned<const double >::value == false );
142
+
143
+ CHECK (is_unsigned<volatile unsigned char >::value == true );
144
+ CHECK (is_unsigned<volatile unsigned int >::value == true );
145
+ CHECK (is_unsigned<volatile unsigned short >::value == true );
146
+ CHECK (is_unsigned<volatile unsigned long >::value == true );
147
+ CHECK (is_unsigned<volatile bool >::value == true );
148
+ CHECK (is_unsigned<volatile char >::value == false );
149
+ CHECK (is_unsigned<volatile float >::value == false );
150
+ CHECK (is_unsigned<volatile double >::value == false );
151
+
152
+ CHECK (is_unsigned<const volatile unsigned char >::value == true );
153
+ CHECK (is_unsigned<const volatile unsigned int >::value == true );
154
+ CHECK (is_unsigned<const volatile unsigned short >::value == true );
155
+ CHECK (is_unsigned<const volatile unsigned long >::value == true );
156
+ CHECK (is_unsigned<const volatile bool >::value == true );
157
+ CHECK (is_unsigned<const volatile char >::value == false );
158
+ CHECK (is_unsigned<const volatile float >::value == false );
159
+ CHECK (is_unsigned<const volatile double >::value == false );
160
+ }
161
+
162
+ SECTION (" is_floating_point" ) {
163
+ CHECK (is_floating_point<int >::value == false );
164
+ CHECK (is_floating_point<float >::value == true );
165
+ CHECK (is_floating_point<double >::value == true );
166
+ CHECK (is_floating_point<const float >::value == true );
167
+ CHECK (is_floating_point<const double >::value == true );
168
+ CHECK (is_floating_point<volatile float >::value == true );
169
+ CHECK (is_floating_point<volatile double >::value == true );
170
+ CHECK (is_floating_point<const volatile float >::value == true );
171
+ CHECK (is_floating_point<const volatile double >::value == true );
70
172
}
71
173
72
174
SECTION (" is_convertible" ) {
0 commit comments