[meta] Add hb_declval() macro

This commit is contained in:
Behdad Esfahbod 2019-01-08 14:27:51 -05:00
parent adc5910a63
commit a6c013b1bf
2 changed files with 2 additions and 1 deletions

View File

@ -173,7 +173,7 @@ struct _hb_is_iterator
};
template<typename Iter, typename Item>
struct hb_is_iterator { enum {
value = sizeof (int) == sizeof (hb_declval<_hb_is_iterator<Iter> > () (hb_declval<Iter*> ())) }; };
value = sizeof (int) == sizeof (hb_declval (_hb_is_iterator<Iter>) (hb_declval (Iter*))) }; };
#define hb_is_iterator(Iter, Item) hb_is_iterator<Iter, Item>::value
#define hb_is_sorted_iterator(Iter, Item) \

View File

@ -36,6 +36,7 @@
template <typename T> static inline T hb_declval ();
#define hb_declval(T) (hb_declval<T> ())
template <typename T> struct hb_match_const { typedef T type; enum { value = false }; };
template <typename T> struct hb_match_const<const T> { typedef T type; enum { value = true }; };