File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change 102
102
template<class T> struct add_pointer; (TODO)
103
103
104
104
// other transformations
105
- template<class T> struct type_identity; (TODO )
105
+ template<class T> struct type_identity; (DONE )
106
106
template<class T> struct remove_cvref; (TODO)
107
107
template<class T> struct decay; (TODO)
108
108
template<bool, class T = void> struct enable_if; (NOT-APPLICABLE)
@@ -302,6 +302,21 @@ struct is_compound : bool_constant<!is_fundamental<T>::value> {};
302
302
template <class T>
303
303
struct is_aggregate : is_compound<T> {};
304
304
305
+ template<class T>
306
+ struct type_identity
307
+ {
308
+ using type = T;
309
+ };
310
+
311
+ template<bool B, class T = void >
312
+ struct enable_if {};
313
+
314
+ template<class T>
315
+ struct enable_if<true , T>
316
+ {
317
+ using type = T;
318
+ };
319
+
305
320
// need this crutch because we can't make `#define typeid` work both on expression and types
306
321
template<typename T>
307
322
struct typeid_t;
@@ -397,9 +412,15 @@ using is_compound = std::is_compound<T>;
397
412
template<class T>
398
413
using is_aggregate = std::is_aggregate<T>;
399
414
415
+ template<typename T>
416
+ using type_identity = std::type_identity<T>;
417
+
400
418
template<typename T>
401
419
struct typeid_t : std::integral_constant<uint64_t,typeid (T).hash_code ()> {};
402
420
421
+ template<bool B, class T = void >
422
+ using enable_if = std::enable_if<B, T>;
423
+
403
424
#endif
404
425
405
426
// Overlapping definitions
You can’t perform that action at this time.
0 commit comments