* Algorithms operating on iterators or iteratables.
*/
-template <typename C, typename V> inline
- hb_enable_if_t (hb_is_iterable (C),
-void)
+template <typename C, typename V,
+ hb_enable_if (hb_is_iterable (C))>
+inline void
hb_fill (C& c, const V &v)
{
for (typename C::iter_t i (c); i; i++)
hb_assign (*i, v);
}
-template <typename S, typename D> inline
- hb_enable_if_t (hb_is_iterator (S) && hb_is_iterator (D),
-bool)
+template <typename S, typename D,
+ hb_enable_if (hb_is_iterator (S) && hb_is_iterator (D))>
+inline bool
hb_copy (D id, S is)
{
for (; id && is; ++id, ++is)
B b;
};
-template <typename A, typename B> inline
-typename hb_enable_if<hb_is_iterable (A) && hb_is_iterable (B),
-hb_zip_t<typename A::iter_t, typename B::iter_t> >::type
+template <typename A, typename B,
+ hb_enable_if (hb_is_iterable (A) && hb_is_iterable (B))>
+inline hb_zip_t<typename A::iter_t, typename B::iter_t>
hb_zip (A& a, B &b)
{ return hb_zip_t<typename A::iter_t, typename B::iter_t> (a.iter (), b.iter ()); }
struct hb_enable_if<true, T> { typedef T type; };
#define hb_enable_if(Cond) typename hb_enable_if<(Cond)>::type* = nullptr
-#define hb_enable_if_t(Cond, Type) typename hb_enable_if<(Cond), Type>::type
/*
if (unlikely (!c->extend (*this))) return_trace (false);
return_trace (true);
}
- template <typename Iterator>
- hb_enable_if_t (hb_is_iterator_of (Iterator, const Type),
- bool) serialize (hb_serialize_context_t *c,
- Iterator items)
+ template <typename Iterator,
+ hb_enable_if (hb_is_iterator_of (Iterator, const Type))>
+ bool serialize (hb_serialize_context_t *c, Iterator items)
{
TRACE_SERIALIZE (this);
unsigned count = items.len ();
bool ret = ArrayOf<Type, LenType>::serialize (c, items_len);
return_trace (ret);
}
- template <typename Iterator>
- hb_enable_if_t (hb_is_sorted_iterator_of (Iterator, const Type),
- bool) serialize (hb_serialize_context_t *c,
- Iterator items)
+ template <typename Iterator,
+ hb_enable_if (hb_is_sorted_iterator_of (Iterator, const Type))>
+ bool serialize (hb_serialize_context_t *c, Iterator items)
{
TRACE_SERIALIZE (this);
bool ret = ArrayOf<Type, LenType>::serialize (c, items);
return i;
}
- template <typename Iterator>
- hb_enable_if_t (hb_is_sorted_iterator_of (Iterator, const GlyphID),
- bool) serialize (hb_serialize_context_t *c,
- Iterator glyphs)
+ template <typename Iterator,
+ hb_enable_if (hb_is_sorted_iterator_of (Iterator, const GlyphID))>
+ bool serialize (hb_serialize_context_t *c, Iterator glyphs)
{
TRACE_SERIALIZE (this);
return_trace (glyphArray.serialize (c, glyphs));
NOT_COVERED;
}
- template <typename Iterator>
- hb_enable_if_t (hb_is_sorted_iterator_of (Iterator, const GlyphID),
- bool) serialize (hb_serialize_context_t *c,
- Iterator glyphs)
+ template <typename Iterator,
+ hb_enable_if (hb_is_sorted_iterator_of (Iterator, const GlyphID))>
+ bool serialize (hb_serialize_context_t *c, Iterator glyphs)
{
TRACE_SERIALIZE (this);
if (unlikely (!c->extend_min (*this))) return_trace (false);
}
}
- template <typename Iterator>
- hb_enable_if_t (hb_is_sorted_iterator_of (Iterator, const GlyphID),
- bool) serialize (hb_serialize_context_t *c,
- Iterator glyphs)
+ template <typename Iterator,
+ hb_enable_if (hb_is_sorted_iterator_of (Iterator, const GlyphID))>
+ bool serialize (hb_serialize_context_t *c, Iterator glyphs)
{
TRACE_SERIALIZE (this);
if (unlikely (!c->extend_min (*this))) return_trace (false);
};
-template <typename Iter> static
- hb_enable_if_t (hb_is_iterator (Iter),
-void)
+template <typename Iter,
+ hb_enable_if (hb_is_iterator (Iter))>
+static void
test_iterator (Iter it)
{
Iter default_constructed;
if (it.is_random_access_iterator) {}
}
-template <typename Iterable> static
- hb_enable_if_t (hb_is_iterable (Iterable),
-void)
+template <typename Iterable,
+ hb_enable_if (hb_is_iterable (Iterable))>
+static void
test_iterable (const Iterable &lst = Null(Iterable))
{
// Test that can take iterator from.