diff --git a/src/hb-iter.hh b/src/hb-iter.hh index 57f481de0..87a86b8e4 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -177,29 +177,23 @@ struct hb_is_iterable { enum { value = _hb_is_iterable::value }; } /* The following SFINAE fails to match template parameters to hb_iter_t<>. * As such, just check for member is_iter being there. */ -# if 0 -template char -_hb_is_iterator (T *) {}; +template char +_hb_is_iterator (...) {}; template int _hb_is_iterator (hb_iter_t *) {}; +template int +_hb_is_iterator (hb_iter_t *) {}; +template int +_hb_is_iterator (hb_iter_t *) {}; +template int +_hb_is_iterator (hb_iter_t *) {}; static_assert (sizeof (char) != sizeof (int), ""); -template +template struct hb_is_iterator { enum { - value = sizeof (int) == sizeof (_hb_is_iterator (hb_declval ())) + value = sizeof (int) == sizeof (_hb_is_iterator (hb_declval ())) }; }; -#endif - -template -struct _hb_is_iterator -{ enum { value = false }; }; -template -struct _hb_is_iterator > -{ enum { value = true }; }; - -template -struct hb_is_iterator { enum { value = _hb_is_iterator::value }; }; -#define hb_is_iterator(Iterator) hb_is_iterator::value +#define hb_is_iterator(Iter, Item) hb_is_iterator::value /* diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh index a1e30d202..60986a847 100644 --- a/src/hb-open-type.hh +++ b/src/hb-open-type.hh @@ -553,7 +553,7 @@ struct ArrayOf return_trace (true); } template - hb_enable_if_t (hb_is_iterator (Iterator), + hb_enable_if_t (hb_is_iterator (Iterator, Type), bool) serialize (hb_serialize_context_t *c, Iterator items) {