[meta] Move typename around

We'll see if bots like.
This commit is contained in:
Behdad Esfahbod 2018-12-30 18:54:07 -05:00
parent f64ea8fc65
commit d552b6818c
5 changed files with 9 additions and 9 deletions

View File

@ -283,7 +283,7 @@ struct hb_atomic_int_t
template <typename P>
struct hb_atomic_ptr_t
{
typedef typename hb_remove_pointer (P) T;
typedef hb_remove_pointer (P) T;
void init (T* v_ = nullptr) { set_relaxed (v_); }
void set_relaxed (T* v_) { hb_atomic_ptr_impl_set_relaxed (&v, v_); }

View File

@ -81,7 +81,7 @@ struct hb_blob_t
template <typename P>
struct hb_blob_ptr_t
{
typedef typename hb_remove_pointer (P) T;
typedef hb_remove_pointer (P) T;
hb_blob_ptr_t (hb_blob_t *b_ = nullptr) : b (b_) {}
hb_blob_t * operator = (hb_blob_t *b_) { return b = b_; }

View File

@ -68,7 +68,7 @@ struct hb_iter_t
explicit_operator bool () const { return thiz()->__more__ (); }
unsigned len () const { return thiz()->__len__ (); }
/* TODO enable_if item_t is reference type only. */
typename hb_remove_reference (item_t)* operator -> () const { return hb_addressof (*thiz()); }
hb_remove_reference (item_t)* operator -> () const { return hb_addressof (*thiz()); }
item_t operator * () const { return thiz()->__item__ (); }
item_t operator [] (unsigned i) const { return thiz()->__item_at__ (i); }
iter_t& operator += (unsigned count) { thiz()->__forward__ (count); return *thiz(); }

View File

@ -39,13 +39,13 @@ template <typename T> static inline T hb_declval ();
template <typename T> struct hb_remove_const { typedef T value; };
template <typename T> struct hb_remove_const<const T> { typedef T value; };
#define hb_remove_const(T) hb_remove_const<T>::value
#define hb_remove_const(T) typename hb_remove_const<T>::value
template <typename T> struct hb_remove_reference { typedef T value; };
template <typename T> struct hb_remove_reference<T &> { typedef T value; };
#define hb_remove_reference(T) hb_remove_reference<T>::value
#define hb_remove_reference(T) typename hb_remove_reference<T>::value
template <typename T> struct hb_remove_pointer { typedef T value; };
template <typename T> struct hb_remove_pointer<T *> { typedef T value; };
#define hb_remove_pointer(T) hb_remove_pointer<T>::value
#define hb_remove_pointer(T) typename hb_remove_pointer<T>::value
/* Void! For when we need a expression-type of void. */

View File

@ -111,7 +111,7 @@ static inline Type const & Null () {
template <typename QType>
struct NullHelper
{
typedef typename hb_remove_const (typename hb_remove_reference (QType)) Type;
typedef hb_remove_const (hb_remove_reference (QType)) Type;
static const Type & get_null () { return Null<Type> (); }
};
#define Null(Type) NullHelper<Type>::get_null ()
@ -160,7 +160,7 @@ static inline Type& Crap () {
template <typename QType>
struct CrapHelper
{
typedef typename hb_remove_const (typename hb_remove_reference (QType)) Type;
typedef hb_remove_const (hb_remove_reference (QType)) Type;
static Type & get_crap () { return Crap<Type> (); }
};
#define Crap(Type) CrapHelper<Type>::get_crap ()
@ -183,7 +183,7 @@ struct CrapOrNullHelper<const Type> {
template <typename P>
struct hb_nonnull_ptr_t
{
typedef typename hb_remove_pointer (P) T;
typedef hb_remove_pointer (P) T;
hb_nonnull_ptr_t (T *v_ = nullptr) : v (v_) {}
T * operator = (T *v_) { return v = v_; }