[meta] Move typename around
authorBehdad Esfahbod <behdad@behdad.org>
Sun, 30 Dec 2018 23:54:07 +0000 (18:54 -0500)
committerBehdad Esfahbod <behdad@behdad.org>
Mon, 21 Jan 2019 01:12:12 +0000 (20:12 -0500)
We'll see if bots like.

src/hb-atomic.hh
src/hb-blob.hh
src/hb-iter.hh
src/hb-meta.hh
src/hb-null.hh

index 165c7aa..d17c50b 100644 (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_); }
index 4ea13f8..3a30efe 100644 (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_; }
index 475c317..b29e878 100644 (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(); }
index feaaa08..bea24b9 100644 (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. */
index 4675c51..7421527 100644 (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_; }