diff --git a/ostd/format.hh b/ostd/format.hh index 9f9b54d..49b5faa 100644 --- a/ostd/format.hh +++ b/ostd/format.hh @@ -492,7 +492,7 @@ namespace detail { template inline Ptrdiff format_ritem(R &writer, Size &fmtn, bool esc, bool, ConstCharRange fmt, const T &item, - EnableIf::value, bool> + EnableIf, bool> = true) { return format_impl(writer, fmtn, esc, fmt, item); } @@ -501,7 +501,7 @@ namespace detail { inline Ptrdiff format_ritem(R &writer, Size &fmtn, bool esc, bool expandval, ConstCharRange fmt, const T &item, - EnableIf::value, bool> + EnableIf, bool> = true) { if (expandval) { return FmtTupleUnpacker>::unpack(writer, diff --git a/ostd/internal/tuple.hh b/ostd/internal/tuple.hh index 4878d26..f341578 100644 --- a/ostd/internal/tuple.hh +++ b/ostd/internal/tuple.hh @@ -45,14 +45,15 @@ using TupleElement = typename TupleElementBase::Type; /* is tuple-like */ -template struct IsTupleLike: False {}; -template struct IsTupleLike: IsTupleLike {}; -template struct IsTupleLike: IsTupleLike {}; -template struct IsTupleLike: IsTupleLike {}; +template constexpr bool IsTupleLike = false; + +template constexpr bool IsTupleLike = IsTupleLike; +template constexpr bool IsTupleLike = IsTupleLike; +template constexpr bool IsTupleLike = IsTupleLike; /* tuple specializations */ -template struct IsTupleLike>: True {}; +template constexpr bool IsTupleLike> = true; template TupleElement> &get(Tuple &); @@ -65,7 +66,7 @@ TupleElement> &&get(Tuple &&); /* pair specializations */ -template struct IsTupleLike>: True {}; +template constexpr bool IsTupleLike> = true; template TupleElement> &get(Pair &); @@ -78,7 +79,7 @@ TupleElement> &&get(Pair &&); /* array specializations */ -template struct IsTupleLike>: True {}; +template constexpr bool IsTupleLike> = true; template T &get(Array &); @@ -145,7 +146,7 @@ public: template constexpr Size TupleSize> = sizeof...(T); -template struct IsTupleLike>: True {}; +template constexpr bool IsTupleLike> = true; /* make tuple types */ @@ -198,8 +199,8 @@ namespace detail { constexpr bool TupleConvertibleApply = TupleConvertibleBase, MakeTupleTypes>; - template>::value, - bool = IsTupleLike::value> + template>, + bool = IsTupleLike> constexpr bool TupleConvertible = false; template @@ -229,8 +230,8 @@ namespace detail { constexpr bool TupleConstructibleApply = TupleConstructibleBase, MakeTupleTypes>; - template>::value, - bool = IsTupleLike::value> + template>, + bool = IsTupleLike> constexpr bool TupleConstructible = false; template @@ -260,8 +261,8 @@ namespace detail { constexpr bool TupleAssignableApply = TupleAssignableBase, MakeTupleTypes>; - template>::value, - bool = IsTupleLike::value> + template>, + bool = IsTupleLike> constexpr bool TupleAssignable = false; template diff --git a/ostd/memory.hh b/ostd/memory.hh index 5ae0a36..7f6722d 100644 --- a/ostd/memory.hh +++ b/ostd/memory.hh @@ -208,11 +208,9 @@ namespace detail { template static char ptr_test(typename T::Pointer * = 0); - template struct HasPtr: Constant(0)) == 1) - > {}; + template constexpr bool HasPtr = sizeof(ptr_test(0)) == 1; - template::value> + template> struct PointerBase { using Type = typename D::Pointer; };