@micro-os-plus/micro-test-plus 3.1.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +347 -1
- package/CMakeLists.txt +9 -11
- package/README.md +12 -1226
- package/include/micro-os-plus/detail.h +69 -36
- package/include/micro-os-plus/inlines.h +50 -7
- package/include/micro-os-plus/literals.h +257 -29
- package/include/micro-os-plus/micro-test-plus.h +257 -68
- package/include/micro-os-plus/reflection.h +10 -5
- package/include/micro-os-plus/test-reporter-inlines.h +2 -2
- package/include/micro-os-plus/test-reporter.h +14 -4
- package/include/micro-os-plus/test-runner.h +3 -2
- package/include/micro-os-plus/test-suite.h +72 -6
- package/include/micro-os-plus/type-traits.h +54 -10
- package/meson.build +23 -17
- package/package.json +25 -535
- package/src/micro-test-plus.cpp +45 -0
- package/src/test-reporter.cpp +11 -1
- package/src/test-runner.cpp +11 -4
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
#include "type-traits.h"
|
|
27
27
|
#include "math.h"
|
|
28
|
+
#include <cstdint>
|
|
28
29
|
|
|
29
30
|
// ----------------------------------------------------------------------------
|
|
30
31
|
|
|
@@ -47,135 +48,235 @@ namespace micro_os_plus::micro_test_plus
|
|
|
47
48
|
*/
|
|
48
49
|
namespace literals
|
|
49
50
|
{
|
|
51
|
+
/**
|
|
52
|
+
* @ingroup micro-test-plus-literals
|
|
53
|
+
* @brief Operator to convert to `int`.
|
|
54
|
+
*/
|
|
50
55
|
template <char... Cs>
|
|
51
|
-
[[nodiscard]] constexpr auto
|
|
56
|
+
[[nodiscard]] constexpr auto
|
|
57
|
+
operator""_i ()
|
|
52
58
|
{
|
|
53
59
|
return type_traits::integral_constant<math::num<int, Cs...> ()>{};
|
|
54
60
|
}
|
|
55
61
|
|
|
62
|
+
/**
|
|
63
|
+
* @ingroup micro-test-plus-literals
|
|
64
|
+
* @brief Operator to convert to `short`.
|
|
65
|
+
*/
|
|
56
66
|
template <char... Cs>
|
|
57
|
-
[[nodiscard]] constexpr auto
|
|
67
|
+
[[nodiscard]] constexpr auto
|
|
68
|
+
operator""_s ()
|
|
58
69
|
{
|
|
59
70
|
return type_traits::integral_constant<math::num<short, Cs...> ()>{};
|
|
60
71
|
}
|
|
61
72
|
|
|
73
|
+
/**
|
|
74
|
+
* @ingroup micro-test-plus-literals
|
|
75
|
+
* @brief Operator to convert to `char`.
|
|
76
|
+
*/
|
|
62
77
|
template <char... Cs>
|
|
63
|
-
[[nodiscard]] constexpr auto
|
|
78
|
+
[[nodiscard]] constexpr auto
|
|
79
|
+
operator""_c ()
|
|
64
80
|
{
|
|
65
81
|
return type_traits::integral_constant<math::num<char, Cs...> ()>{};
|
|
66
82
|
}
|
|
67
83
|
|
|
84
|
+
/**
|
|
85
|
+
* @ingroup micro-test-plus-literals
|
|
86
|
+
* @brief Operator to convert to `signed char`.
|
|
87
|
+
*/
|
|
68
88
|
template <char... Cs>
|
|
69
|
-
[[nodiscard]] constexpr auto
|
|
89
|
+
[[nodiscard]] constexpr auto
|
|
90
|
+
operator""_sc ()
|
|
70
91
|
{
|
|
71
92
|
return type_traits::integral_constant<
|
|
72
93
|
math::num<signed char, Cs...> ()>{};
|
|
73
94
|
}
|
|
74
95
|
|
|
96
|
+
/**
|
|
97
|
+
* @ingroup micro-test-plus-literals
|
|
98
|
+
* @brief Operator to convert to `long`.
|
|
99
|
+
*/
|
|
75
100
|
template <char... Cs>
|
|
76
|
-
[[nodiscard]] constexpr auto
|
|
101
|
+
[[nodiscard]] constexpr auto
|
|
102
|
+
operator""_l ()
|
|
77
103
|
{
|
|
78
104
|
return type_traits::integral_constant<math::num<long, Cs...> ()>{};
|
|
79
105
|
}
|
|
80
106
|
|
|
107
|
+
/**
|
|
108
|
+
* @ingroup micro-test-plus-literals
|
|
109
|
+
* @brief Operator to convert to `long long`.
|
|
110
|
+
*/
|
|
81
111
|
template <char... Cs>
|
|
82
|
-
[[nodiscard]] constexpr auto
|
|
112
|
+
[[nodiscard]] constexpr auto
|
|
113
|
+
operator""_ll ()
|
|
83
114
|
{
|
|
84
115
|
return type_traits::integral_constant<math::num<long long, Cs...> ()>{};
|
|
85
116
|
}
|
|
86
117
|
|
|
118
|
+
/**
|
|
119
|
+
* @ingroup micro-test-plus-literals
|
|
120
|
+
* @brief Operator to convert to `unsigned`.
|
|
121
|
+
*/
|
|
87
122
|
template <char... Cs>
|
|
88
|
-
[[nodiscard]] constexpr auto
|
|
123
|
+
[[nodiscard]] constexpr auto
|
|
124
|
+
operator""_u ()
|
|
89
125
|
{
|
|
90
126
|
return type_traits::integral_constant<math::num<unsigned, Cs...> ()>{};
|
|
91
127
|
}
|
|
92
128
|
|
|
129
|
+
/**
|
|
130
|
+
* @ingroup micro-test-plus-literals
|
|
131
|
+
* @brief Operator to convert to `unsigned char`.
|
|
132
|
+
*/
|
|
93
133
|
template <char... Cs>
|
|
94
|
-
[[nodiscard]] constexpr auto
|
|
134
|
+
[[nodiscard]] constexpr auto
|
|
135
|
+
operator""_uc ()
|
|
95
136
|
{
|
|
96
137
|
return type_traits::integral_constant<
|
|
97
138
|
math::num<unsigned char, Cs...> ()>{};
|
|
98
139
|
}
|
|
99
140
|
|
|
141
|
+
/**
|
|
142
|
+
* @ingroup micro-test-plus-literals
|
|
143
|
+
* @brief Operator to convert to `unsigned short`.
|
|
144
|
+
*/
|
|
100
145
|
template <char... Cs>
|
|
101
|
-
[[nodiscard]] constexpr auto
|
|
146
|
+
[[nodiscard]] constexpr auto
|
|
147
|
+
operator""_us ()
|
|
102
148
|
{
|
|
103
149
|
return type_traits::integral_constant<
|
|
104
150
|
math::num<unsigned short, Cs...> ()>{};
|
|
105
151
|
}
|
|
106
152
|
|
|
153
|
+
/**
|
|
154
|
+
* @ingroup micro-test-plus-literals
|
|
155
|
+
* @brief Operator to convert to `unsigned long`.
|
|
156
|
+
*/
|
|
107
157
|
template <char... Cs>
|
|
108
|
-
[[nodiscard]] constexpr auto
|
|
158
|
+
[[nodiscard]] constexpr auto
|
|
159
|
+
operator""_ul ()
|
|
109
160
|
{
|
|
110
161
|
return type_traits::integral_constant<
|
|
111
162
|
math::num<unsigned long, Cs...> ()>{};
|
|
112
163
|
}
|
|
113
164
|
|
|
165
|
+
/**
|
|
166
|
+
* @ingroup micro-test-plus-literals
|
|
167
|
+
* @brief Operator to convert to `unsigned long long`.
|
|
168
|
+
*/
|
|
114
169
|
template <char... Cs>
|
|
115
|
-
[[nodiscard]] constexpr auto
|
|
170
|
+
[[nodiscard]] constexpr auto
|
|
171
|
+
operator""_ull ()
|
|
116
172
|
{
|
|
117
173
|
return type_traits::integral_constant<
|
|
118
174
|
math::num<unsigned long long, Cs...> ()>{};
|
|
119
175
|
}
|
|
120
176
|
|
|
177
|
+
/**
|
|
178
|
+
* @ingroup micro-test-plus-literals
|
|
179
|
+
* @brief Operator to convert to `int8_t`.
|
|
180
|
+
*/
|
|
121
181
|
template <char... Cs>
|
|
122
|
-
[[nodiscard]] constexpr auto
|
|
182
|
+
[[nodiscard]] constexpr auto
|
|
183
|
+
operator""_i8 ()
|
|
123
184
|
{
|
|
124
185
|
return type_traits::integral_constant<
|
|
125
186
|
math::num<std::int8_t, Cs...> ()>{};
|
|
126
187
|
}
|
|
127
188
|
|
|
189
|
+
/**
|
|
190
|
+
* @ingroup micro-test-plus-literals
|
|
191
|
+
* @brief Operator to convert to `int16_t`.
|
|
192
|
+
*/
|
|
128
193
|
template <char... Cs>
|
|
129
|
-
[[nodiscard]] constexpr auto
|
|
194
|
+
[[nodiscard]] constexpr auto
|
|
195
|
+
operator""_i16 ()
|
|
130
196
|
{
|
|
131
197
|
return type_traits::integral_constant<
|
|
132
198
|
math::num<std::int16_t, Cs...> ()>{};
|
|
133
199
|
}
|
|
134
200
|
|
|
201
|
+
/**
|
|
202
|
+
* @ingroup micro-test-plus-literals
|
|
203
|
+
* @brief Operator to convert to `int32_t`.
|
|
204
|
+
*/
|
|
135
205
|
template <char... Cs>
|
|
136
|
-
[[nodiscard]] constexpr auto
|
|
206
|
+
[[nodiscard]] constexpr auto
|
|
207
|
+
operator""_i32 ()
|
|
137
208
|
{
|
|
138
209
|
return type_traits::integral_constant<
|
|
139
210
|
math::num<std::int32_t, Cs...> ()>{};
|
|
140
211
|
}
|
|
141
212
|
|
|
213
|
+
/**
|
|
214
|
+
* @ingroup micro-test-plus-literals
|
|
215
|
+
* @brief Operator to convert to `int64_t`.
|
|
216
|
+
*/
|
|
142
217
|
template <char... Cs>
|
|
143
|
-
[[nodiscard]] constexpr auto
|
|
218
|
+
[[nodiscard]] constexpr auto
|
|
219
|
+
operator""_i64 ()
|
|
144
220
|
{
|
|
145
221
|
return type_traits::integral_constant<
|
|
146
222
|
math::num<std::int64_t, Cs...> ()>{};
|
|
147
223
|
}
|
|
148
224
|
|
|
225
|
+
/**
|
|
226
|
+
* @ingroup micro-test-plus-literals
|
|
227
|
+
* @brief Operator to convert to `uint8_t`.
|
|
228
|
+
*/
|
|
149
229
|
template <char... Cs>
|
|
150
|
-
[[nodiscard]] constexpr auto
|
|
230
|
+
[[nodiscard]] constexpr auto
|
|
231
|
+
operator""_u8 ()
|
|
151
232
|
{
|
|
152
233
|
return type_traits::integral_constant<
|
|
153
234
|
math::num<std::uint8_t, Cs...> ()>{};
|
|
154
235
|
}
|
|
155
236
|
|
|
237
|
+
/**
|
|
238
|
+
* @ingroup micro-test-plus-literals
|
|
239
|
+
* @brief Operator to convert to `uint16_t`.
|
|
240
|
+
*/
|
|
156
241
|
template <char... Cs>
|
|
157
|
-
[[nodiscard]] constexpr auto
|
|
242
|
+
[[nodiscard]] constexpr auto
|
|
243
|
+
operator""_u16 ()
|
|
158
244
|
{
|
|
159
245
|
return type_traits::integral_constant<
|
|
160
246
|
math::num<std::uint16_t, Cs...> ()>{};
|
|
161
247
|
}
|
|
162
248
|
|
|
249
|
+
/**
|
|
250
|
+
* @ingroup micro-test-plus-literals
|
|
251
|
+
* @brief Operator to convert to `uint32_t`.
|
|
252
|
+
*/
|
|
163
253
|
template <char... Cs>
|
|
164
|
-
[[nodiscard]] constexpr auto
|
|
254
|
+
[[nodiscard]] constexpr auto
|
|
255
|
+
operator""_u32 ()
|
|
165
256
|
{
|
|
166
257
|
return type_traits::integral_constant<
|
|
167
258
|
math::num<std::uint32_t, Cs...> ()>{};
|
|
168
259
|
}
|
|
169
260
|
|
|
261
|
+
/**
|
|
262
|
+
* @ingroup micro-test-plus-literals
|
|
263
|
+
* @brief Operator to convert to `uint64_t`.
|
|
264
|
+
*/
|
|
170
265
|
template <char... Cs>
|
|
171
|
-
[[nodiscard]] constexpr auto
|
|
266
|
+
[[nodiscard]] constexpr auto
|
|
267
|
+
operator""_u64 ()
|
|
172
268
|
{
|
|
173
269
|
return type_traits::integral_constant<
|
|
174
270
|
math::num<std::uint64_t, Cs...> ()>{};
|
|
175
271
|
}
|
|
176
272
|
|
|
273
|
+
/**
|
|
274
|
+
* @ingroup micro-test-plus-literals
|
|
275
|
+
* @brief Operator to convert to `float`.
|
|
276
|
+
*/
|
|
177
277
|
template <char... Cs>
|
|
178
|
-
[[nodiscard]] constexpr auto
|
|
278
|
+
[[nodiscard]] constexpr auto
|
|
279
|
+
operator""_f ()
|
|
179
280
|
{
|
|
180
281
|
return type_traits::floating_point_constant<
|
|
181
282
|
float, math::num<unsigned long, Cs...> (),
|
|
@@ -183,8 +284,13 @@ namespace micro_os_plus::micro_test_plus
|
|
|
183
284
|
math::den_size<unsigned long, Cs...> ()>{};
|
|
184
285
|
}
|
|
185
286
|
|
|
287
|
+
/**
|
|
288
|
+
* @ingroup micro-test-plus-literals
|
|
289
|
+
* @brief Operator to convert to `double`.
|
|
290
|
+
*/
|
|
186
291
|
template <char... Cs>
|
|
187
|
-
[[nodiscard]] constexpr auto
|
|
292
|
+
[[nodiscard]] constexpr auto
|
|
293
|
+
operator""_d ()
|
|
188
294
|
{
|
|
189
295
|
return type_traits::floating_point_constant<
|
|
190
296
|
double, math::num<unsigned long, Cs...> (),
|
|
@@ -192,8 +298,13 @@ namespace micro_os_plus::micro_test_plus
|
|
|
192
298
|
math::den_size<unsigned long, Cs...> ()>{};
|
|
193
299
|
}
|
|
194
300
|
|
|
301
|
+
/**
|
|
302
|
+
* @ingroup micro-test-plus-literals
|
|
303
|
+
* @brief Operator to convert to `long double`.
|
|
304
|
+
*/
|
|
195
305
|
template <char... Cs>
|
|
196
|
-
[[nodiscard]] constexpr auto
|
|
306
|
+
[[nodiscard]] constexpr auto
|
|
307
|
+
operator""_ld ()
|
|
197
308
|
{
|
|
198
309
|
return type_traits::floating_point_constant<
|
|
199
310
|
long double, math::num<unsigned long long, Cs...> (),
|
|
@@ -201,12 +312,18 @@ namespace micro_os_plus::micro_test_plus
|
|
|
201
312
|
math::den_size<unsigned long long, Cs...> ()>{};
|
|
202
313
|
}
|
|
203
314
|
|
|
204
|
-
|
|
315
|
+
/**
|
|
316
|
+
* @ingroup micro-test-plus-literals
|
|
317
|
+
* @brief Operator to convert to `bool`.
|
|
318
|
+
*/
|
|
319
|
+
constexpr auto
|
|
320
|
+
operator""_b (const char* name, decltype (sizeof ("")) size)
|
|
205
321
|
{
|
|
206
322
|
struct named : std::string_view, type_traits::op
|
|
207
323
|
{
|
|
208
324
|
using value_type = bool;
|
|
209
|
-
[[nodiscard]] constexpr
|
|
325
|
+
[[nodiscard]] constexpr
|
|
326
|
+
operator value_type () const
|
|
210
327
|
{
|
|
211
328
|
return true;
|
|
212
329
|
}
|
|
@@ -230,35 +347,64 @@ namespace micro_os_plus::micro_test_plus
|
|
|
230
347
|
|
|
231
348
|
// --------------------------------------------------------------------------
|
|
232
349
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
350
|
+
#if defined(__GNUC__)
|
|
351
|
+
#pragma GCC diagnostic push
|
|
352
|
+
#if defined(__clang__)
|
|
353
|
+
#pragma clang diagnostic ignored "-Wdocumentation-deprecated-sync"
|
|
354
|
+
#endif
|
|
355
|
+
#endif
|
|
356
|
+
|
|
357
|
+
/** @deprecated Use `to_b` (since 3.2.0). */
|
|
237
358
|
using _b = type_traits::value<bool>;
|
|
359
|
+
/** @deprecated Use `to_c` (since 3.2.0). */
|
|
238
360
|
using _c = type_traits::value<char>;
|
|
361
|
+
/** @deprecated Use `to_sc` (since 3.2.0). */
|
|
239
362
|
using _sc = type_traits::value<signed char>;
|
|
363
|
+
/** @deprecated Use `to_s` (since 3.2.0). */
|
|
240
364
|
using _s = type_traits::value<short>;
|
|
365
|
+
/** @deprecated Use `to_i` (since 3.2.0). */
|
|
241
366
|
using _i = type_traits::value<int>;
|
|
367
|
+
/** @deprecated Use `to_l` (since 3.2.0). */
|
|
242
368
|
using _l = type_traits::value<long>;
|
|
369
|
+
/** @deprecated Use `to_ll` (since 3.2.0). */
|
|
243
370
|
using _ll = type_traits::value<long long>;
|
|
371
|
+
/** @deprecated Use `to_u` (since 3.2.0). */
|
|
244
372
|
using _u = type_traits::value<unsigned>;
|
|
373
|
+
/** @deprecated Use `to_uc` (since 3.2.0). */
|
|
245
374
|
using _uc = type_traits::value<unsigned char>;
|
|
375
|
+
/** @deprecated Use `to_us` (since 3.2.0). */
|
|
246
376
|
using _us = type_traits::value<unsigned short>;
|
|
377
|
+
/** @deprecated Use `to_ul` (since 3.2.0). */
|
|
247
378
|
using _ul = type_traits::value<unsigned long>;
|
|
379
|
+
/** @deprecated Use `to_ull` (since 3.2.0). */
|
|
248
380
|
using _ull = type_traits::value<unsigned long long>;
|
|
381
|
+
/** @deprecated Use `to_i8` (since 3.2.0). */
|
|
249
382
|
using _i8 = type_traits::value<std::int8_t>;
|
|
383
|
+
/** @deprecated Use `to_i16` (since 3.2.0). */
|
|
250
384
|
using _i16 = type_traits::value<std::int16_t>;
|
|
385
|
+
/** @deprecated Use `to_i32` (since 3.2.0). */
|
|
251
386
|
using _i32 = type_traits::value<std::int32_t>;
|
|
387
|
+
/** @deprecated Use `to_i64` (since 3.2.0). */
|
|
252
388
|
using _i64 = type_traits::value<std::int64_t>;
|
|
389
|
+
/** @deprecated Use `to_u8` (since 3.2.0). */
|
|
253
390
|
using _u8 = type_traits::value<std::uint8_t>;
|
|
391
|
+
/** @deprecated Use `to_u16` (since 3.2.0). */
|
|
254
392
|
using _u16 = type_traits::value<std::uint16_t>;
|
|
393
|
+
/** @deprecated Use `to_u32` (since 3.2.0). */
|
|
255
394
|
using _u32 = type_traits::value<std::uint32_t>;
|
|
395
|
+
/** @deprecated Use `to_u64` (since 3.2.0). */
|
|
256
396
|
using _u64 = type_traits::value<std::uint64_t>;
|
|
397
|
+
/** @deprecated Use `to_f` (since 3.2.0). */
|
|
257
398
|
using _f = type_traits::value<float>;
|
|
399
|
+
/** @deprecated Use `to_d` (since 3.2.0). */
|
|
258
400
|
using _d = type_traits::value<double>;
|
|
401
|
+
/** @deprecated Use `to_ld` (since 3.2.0). */
|
|
259
402
|
using _ld = type_traits::value<long double>;
|
|
260
403
|
|
|
261
|
-
|
|
404
|
+
/**
|
|
405
|
+
* @deprecated Use `to_t` (since 3.2.0).
|
|
406
|
+
* @headerfile micro-test-plus.h <micro-os-plus/micro-test-plus.h>
|
|
407
|
+
*/
|
|
262
408
|
template <class T>
|
|
263
409
|
struct _t : type_traits::value<T>
|
|
264
410
|
{
|
|
@@ -267,6 +413,88 @@ namespace micro_os_plus::micro_test_plus
|
|
|
267
413
|
}
|
|
268
414
|
};
|
|
269
415
|
|
|
416
|
+
#if defined(__GNUC__)
|
|
417
|
+
#pragma GCC diagnostic pop
|
|
418
|
+
#endif
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* @addtogroup micro-test-plus-literals
|
|
422
|
+
* @{
|
|
423
|
+
*/
|
|
424
|
+
|
|
425
|
+
// Wrappers that can be used to convert dynamic values to specific types
|
|
426
|
+
// that are recognised by the comparators.
|
|
427
|
+
// The syntax is similar to function calls, like `_i(expression)`, but the
|
|
428
|
+
// results have custom types expected by comparators.
|
|
429
|
+
/** @since 3.2.0 */
|
|
430
|
+
using to_b = type_traits::value<bool>;
|
|
431
|
+
/** @since 3.2.0 */
|
|
432
|
+
using to_c = type_traits::value<char>;
|
|
433
|
+
/** @since 3.2.0 */
|
|
434
|
+
using to_sc = type_traits::value<signed char>;
|
|
435
|
+
/** @since 3.2.0 */
|
|
436
|
+
using to_s = type_traits::value<short>;
|
|
437
|
+
/** @since 3.2.0 */
|
|
438
|
+
using to_i = type_traits::value<int>;
|
|
439
|
+
/** @since 3.2.0 */
|
|
440
|
+
using to_l = type_traits::value<long>;
|
|
441
|
+
/** @since 3.2.0 */
|
|
442
|
+
using to_ll = type_traits::value<long long>;
|
|
443
|
+
/** @since 3.2.0 */
|
|
444
|
+
using to_u = type_traits::value<unsigned>;
|
|
445
|
+
/** @since 3.2.0 */
|
|
446
|
+
using to_uc = type_traits::value<unsigned char>;
|
|
447
|
+
/** @since 3.2.0 */
|
|
448
|
+
using to_us = type_traits::value<unsigned short>;
|
|
449
|
+
/** @since 3.2.0 */
|
|
450
|
+
using to_ul = type_traits::value<unsigned long>;
|
|
451
|
+
/** @since 3.2.0 */
|
|
452
|
+
using to_ull = type_traits::value<unsigned long long>;
|
|
453
|
+
/** @since 3.2.0 */
|
|
454
|
+
using to_i8 = type_traits::value<std::int8_t>;
|
|
455
|
+
/** @since 3.2.0 */
|
|
456
|
+
using to_i16 = type_traits::value<std::int16_t>;
|
|
457
|
+
/** @since 3.2.0 */
|
|
458
|
+
using to_i32 = type_traits::value<std::int32_t>;
|
|
459
|
+
/** @since 3.2.0 */
|
|
460
|
+
using to_i64 = type_traits::value<std::int64_t>;
|
|
461
|
+
/** @since 3.2.0 */
|
|
462
|
+
using to_u8 = type_traits::value<std::uint8_t>;
|
|
463
|
+
/** @since 3.2.0 */
|
|
464
|
+
using to_u16 = type_traits::value<std::uint16_t>;
|
|
465
|
+
/** @since 3.2.0 */
|
|
466
|
+
using to_u32 = type_traits::value<std::uint32_t>;
|
|
467
|
+
/** @since 3.2.0 */
|
|
468
|
+
using to_u64 = type_traits::value<std::uint64_t>;
|
|
469
|
+
/** @since 3.2.0 */
|
|
470
|
+
using to_f = type_traits::value<float>;
|
|
471
|
+
/** @since 3.2.0 */
|
|
472
|
+
using to_d = type_traits::value<double>;
|
|
473
|
+
/** @since 3.2.0 */
|
|
474
|
+
using to_ld = type_traits::value<long double>;
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* @}
|
|
478
|
+
*/
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* @ingroup micro-test-plus-literals
|
|
482
|
+
* @brief Template for wrapping any other type.
|
|
483
|
+
* @headerfile micro-test-plus.h <micro-os-plus/micro-test-plus.h>
|
|
484
|
+
* @since 3.2.0
|
|
485
|
+
*
|
|
486
|
+
* @details
|
|
487
|
+
* A public class used only to convert the type.
|
|
488
|
+
*/
|
|
489
|
+
template <class T>
|
|
490
|
+
struct to_t : type_traits::value<T>
|
|
491
|
+
{
|
|
492
|
+
/** @brief Constructor. */
|
|
493
|
+
constexpr explicit to_t (const T& t) : type_traits::value<T>{ t }
|
|
494
|
+
{
|
|
495
|
+
}
|
|
496
|
+
};
|
|
497
|
+
|
|
270
498
|
// --------------------------------------------------------------------------
|
|
271
499
|
} // namespace micro_os_plus::micro_test_plus
|
|
272
500
|
|