diff --git a/src/hb-algs.hh b/src/hb-algs.hh index 6981d06ae..3d7badb32 100644 --- a/src/hb-algs.hh +++ b/src/hb-algs.hh @@ -42,7 +42,8 @@ struct //{ return hb_deref_pointer (v).hash (); } /* Instead, the following ugly soution: */ template + hb_enable_if (!hb_is_integer (hb_remove_const >) && + !hb_is_pointer (T))> uint32_t operator () (T&& v) const { return v.hash (); } template diff --git a/src/hb-array.hh b/src/hb-array.hh index d42e086bd..74b6757b2 100644 --- a/src/hb-array.hh +++ b/src/hb-array.hh @@ -47,13 +47,13 @@ struct hb_array_t : hb_iter_with_fallback_t, Type&> hb_iter_with_fallback_t, Type&> (), arrayZ (o.arrayZ), length (o.length) {} template - hb_array_t (const hb_array_t &o) : arrayZ (o.arrayZ), length (o.length) {} + hb_array_t (const hb_array_t > &o) : arrayZ (o.arrayZ), length (o.length) {} hb_array_t (Type *array_, unsigned int length_) : arrayZ (array_), length (length_) {} template hb_array_t (Type (&array_)[length_]) : arrayZ (array_), length (length_) {} template - hb_array_t& operator = (const hb_array_t &o) + hb_array_t& operator = (const hb_array_t > &o) { arrayZ = o.arrayZ; length = o.length; return *this; } hb_array_t& operator = (const hb_array_t &o) { arrayZ = o.arrayZ; length = o.length; return *this; } @@ -214,7 +214,7 @@ struct hb_sorted_array_t : hb_sorted_array_t () : hb_array_t () {} hb_sorted_array_t (const hb_array_t &o) : hb_array_t (o) {} template - hb_sorted_array_t (const hb_sorted_array_t &o) : hb_array_t (o) {} + hb_sorted_array_t (const hb_sorted_array_t > &o) : hb_array_t (o) {} hb_sorted_array_t (Type *array_, unsigned int length_) : hb_array_t (array_, length_) {} template hb_sorted_array_t (Type (&array_)[length_]) : hb_array_t (array_) {} diff --git a/src/hb-atomic.hh b/src/hb-atomic.hh index a2ce8f28d..8307a549d 100644 --- a/src/hb-atomic.hh +++ b/src/hb-atomic.hh @@ -283,7 +283,7 @@ struct hb_atomic_int_t template struct hb_atomic_ptr_t { - typedef hb_remove_pointer (P) T; + typedef hb_remove_pointer

T; void init (T* v_ = nullptr) { set_relaxed (v_); } void set_relaxed (T* v_) { hb_atomic_ptr_impl_set_relaxed (&v, v_); } diff --git a/src/hb-blob.hh b/src/hb-blob.hh index 3a30efe55..cff492fa0 100644 --- a/src/hb-blob.hh +++ b/src/hb-blob.hh @@ -81,7 +81,7 @@ struct hb_blob_t template struct hb_blob_ptr_t { - typedef hb_remove_pointer (P) T; + typedef hb_remove_pointer

T; hb_blob_ptr_t (hb_blob_t *b_ = nullptr) : b (b_) {} hb_blob_t * operator = (hb_blob_t *b_) { return b = b_; } diff --git a/src/hb-common.cc b/src/hb-common.cc index ab93bf427..356c2bf17 100644 --- a/src/hb-common.cc +++ b/src/hb-common.cc @@ -783,7 +783,7 @@ parse_uint32 (const char **pp, const char *end, uint32_t *pv) static void free_static_C_locale (); #endif -static struct hb_C_locale_lazy_loader_t : hb_lazy_loader_t, hb_C_locale_lazy_loader_t> { static HB_LOCALE_T create () diff --git a/src/hb-ft.cc b/src/hb-ft.cc index 48434dc8c..f8dab8bc1 100644 --- a/src/hb-ft.cc +++ b/src/hb-ft.cc @@ -748,7 +748,7 @@ hb_ft_font_create_referenced (FT_Face ft_face) static void free_static_ft_library (); #endif -static struct hb_ft_library_lazy_loader_t : hb_lazy_loader_t, hb_ft_library_lazy_loader_t> { static FT_Library create () diff --git a/src/hb-iter.hh b/src/hb-iter.hh index 7e7673326..38d477027 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -78,7 +78,7 @@ struct hb_iter_t * it will be returning pointer to temporary rvalue. */ template - hb_remove_reference (item_t)* operator -> () const { return hb_addressof (**thiz()); } + hb_remove_reference* operator -> () const { return hb_addressof (**thiz()); } item_t operator * () const { return thiz()->__item__ (); } item_t operator * () { return thiz()->__item__ (); } item_t operator [] (unsigned i) const { return thiz()->__item_at__ (i); } diff --git a/src/hb-meta.hh b/src/hb-meta.hh index 83b0ad6b3..a5edd0372 100644 --- a/src/hb-meta.hh +++ b/src/hb-meta.hh @@ -56,15 +56,15 @@ template static inline T hb_declval (); template struct hb_match_const { typedef T type; enum { value = false }; }; template struct hb_match_const { typedef T type; enum { value = true }; }; -#define hb_remove_const(T) typename hb_match_const::type +template using hb_remove_const = typename hb_match_const::type; #define hb_is_const(T) hb_match_const::value template struct hb_match_reference { typedef T type; enum { value = false }; }; template struct hb_match_reference { typedef T type; enum { value = true }; }; -#define hb_remove_reference(T) typename hb_match_reference::type +template using hb_remove_reference = typename hb_match_reference::type; #define hb_is_reference(T) hb_match_reference::value template struct hb_match_pointer { typedef T type; enum { value = false }; }; template struct hb_match_pointer { typedef T type; enum { value = true }; }; -#define hb_remove_pointer(T) typename hb_match_pointer::type +template using hb_remove_pointer = typename hb_match_pointer::type; #define hb_is_pointer(T) hb_match_pointer::value struct @@ -79,12 +79,12 @@ struct /* std::move and std::forward */ template -static hb_remove_reference (T)&& hb_move (T&& t) { return (hb_remove_reference (T)&&) (t); } +static hb_remove_reference&& hb_move (T&& t) { return (hb_remove_reference&&) (t); } template -static T&& hb_forward (hb_remove_reference (T)& t) { return (T&&) t; } +static T&& hb_forward (hb_remove_reference& t) { return (T&&) t; } template -static T&& hb_forward (hb_remove_reference (T)&& t) { return (T&&) t; } +static T&& hb_forward (hb_remove_reference&& t) { return (T&&) t; } /* Void! For when we need a expression-type of void. */ diff --git a/src/hb-null.hh b/src/hb-null.hh index 6d4a68360..1e20a47e9 100644 --- a/src/hb-null.hh +++ b/src/hb-null.hh @@ -95,7 +95,7 @@ struct Null { template struct NullHelper { - typedef hb_remove_const (hb_remove_reference (QType)) Type; + typedef hb_remove_const > Type; static const Type & get_null () { return Null::get_null (); } }; #define Null(Type) NullHelper::get_null () @@ -148,7 +148,7 @@ static inline Type& Crap () { template struct CrapHelper { - typedef hb_remove_const (hb_remove_reference (QType)) Type; + typedef hb_remove_const > Type; static Type & get_crap () { return Crap (); } }; #define Crap(Type) CrapHelper::get_crap () @@ -171,7 +171,7 @@ struct CrapOrNullHelper { template struct hb_nonnull_ptr_t { - typedef hb_remove_pointer (P) T; + typedef hb_remove_pointer

T; hb_nonnull_ptr_t (T *v_ = nullptr) : v (v_) {} T * operator = (T *v_) { return v = v_; }