提交 a6c013b1 编写于 作者: B Behdad Esfahbod

[meta] Add hb_declval() macro

上级 adc5910a
......@@ -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) \
......
......@@ -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 }; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册