[meta] Move code around
authorBehdad Esfahbod <behdad@behdad.org>
Sun, 30 Dec 2018 23:49:34 +0000 (18:49 -0500)
committerBehdad Esfahbod <behdad@behdad.org>
Mon, 21 Jan 2019 01:12:12 +0000 (20:12 -0500)
src/hb-atomic.hh
src/hb-meta.hh
src/hb.hh

index 9321932..165c7aa 100644 (file)
@@ -33,6 +33,7 @@
 #define HB_ATOMIC_HH
 
 #include "hb.hh"
+#include "hb-meta.hh"
 
 
 /*
index 6646d28..feaaa08 100644 (file)
 
 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
+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
+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
+
 
 /* Void!  For when we need a expression-type of void. */
 struct hb_void_t { typedef void value; };
index 503f24f..3e75adb 100644 (file)
--- a/src/hb.hh
+++ b/src/hb.hh
@@ -612,24 +612,12 @@ _hb_memalign(void **memptr, size_t alignment, size_t size)
 #define HB_SCRIPT_MYANMAR_ZAWGYI       ((hb_script_t) HB_TAG ('Q','a','a','g'))
 
 
-/* Some really basic things everyone wants. */
-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
-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
-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
-
-
 /* Headers we include for everyone.  Keep topologically sorted by dependency.
  * They express dependency amongst themselves, but no other file should include
  * them directly.*/
-#include "hb-atomic.hh"
 #include "hb-meta.hh"
 #include "hb-mutex.hh"
+#include "hb-atomic.hh"        // Requires: hb-meta
 #include "hb-null.hh"  // Requires: hb-meta
 #include "hb-dsalgs.hh"        // Requires: hb-null
 #include "hb-iter.hh"  // Requires: hb-dsalgs hb-meta hb-null