diff --git a/src/hb-meta.hh b/src/hb-meta.hh index 3808d917b..4ec3702bf 100644 --- a/src/hb-meta.hh +++ b/src/hb-meta.hh @@ -132,15 +132,6 @@ template using hb_add_pointer = decltype (_hb_try_add_pointer (h /* TODO Add feature-parity to std::decay. */ template using hb_decay = hb_remove_const>; - -template -struct _hb_conditional { typedef T type; }; -template -struct _hb_conditional { typedef F type; }; -template -using hb_conditional = typename _hb_conditional::type; - - template struct hb_is_convertible { @@ -150,7 +141,7 @@ struct hb_is_convertible static constexpr bool either_void = from_void || to_void; static constexpr bool both_void = from_void && to_void; - static hb_true_type impl2 (hb_conditional); + static hb_true_type impl2 (typename std::conditional::type); template static auto impl (hb_priority<1>) -> decltype (impl2 (hb_declval (T))); @@ -159,7 +150,7 @@ struct hb_is_convertible public: static constexpr bool value = both_void || (!either_void && - decltype (impl> (hb_prioritize))::value); + decltype (impl::type> (hb_prioritize))::value); }; #define hb_is_convertible(From,To) hb_is_convertible::value diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh index 1504584f1..7e524177f 100644 --- a/src/hb-open-type.hh +++ b/src/hb-open-type.hh @@ -64,7 +64,7 @@ struct IntType IntType& operator = (Type i) { v = i; return *this; } /* For reason we define cast out operator for signed/unsigned, instead of Type, see: * https://github.com/harfbuzz/harfbuzz/pull/2875/commits/09836013995cab2b9f07577a179ad7b024130467 */ - operator hb_conditional::value, signed, unsigned> () const { return v; } + operator typename std::conditional::value, signed, unsigned>::type () const { return v; } bool operator == (const IntType &o) const { return (Type) v == (Type) o.v; } bool operator != (const IntType &o) const { return !(*this == o); }