Skip to content

Commit 2ed5d30

Browse files
committed
Headers: Add a way to select simplified implementation of enable_if
1 parent f566757 commit 2ed5d30

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

headers/type_traits

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,18 @@ template<class T>
368368
using decay_t = T; // SIMPLIFIED typedef
369369
#endif
370370

371+
#if CPPREFERENCE_SIMPLIFY_TYPEDEFS
372+
373+
template<bool, class T = void> struct enable_if {
374+
typedef int type; // SIMPLIFIED type
375+
};
376+
#if CPPREFERENCE_STDVER >= 2014
377+
template<bool, class T = void>
378+
using enable_if_t = int; // SIMPLIFIED typedef
379+
#endif
380+
381+
#else
382+
371383
template<bool, class T = void> struct enable_if {};
372384

373385
template<class T>
@@ -379,6 +391,8 @@ template<bool B, class T = void>
379391
using enable_if_t = typename enable_if<B, T>::type;
380392
#endif
381393

394+
#endif // CPPREFERENCE_SIMPLIFY_TYPEDEFS
395+
382396
template<bool, class T, class F> struct conditional {
383397
typedef int type; // SIMPLIFIED type
384398
};

0 commit comments

Comments
 (0)