[iter] Fix hb_iter()

This commit is contained in:
Behdad Esfahbod committed 2019-01-27 00:50:54 +01:00
1 parent 2f5b1a9104
commit 778c96b8d7
3 files changed
+8 -8

No files matched your search

-4
View File
@@ -31,10 +31,6 @@
#include "hb-null.hh"
template <typename T>
inline typename T::iter_t
hb_iter (const T& c) { return c.iter (); }
static HB_UNUSED const struct hb_identity_ft
{
template <typename T> T
+7 -3
View File
@@ -91,9 +91,6 @@ struct hb_iter_t
void operator = (const hb_iter_t &o HB_UNUSED) {}
};
/* Returns iterator type of a type. */
#define hb_iter_t(Iterable) decltype (hb_declval (Iterable).iter ())
#define HB_ITER_USING(Name) \
using item_t = typename Name::item_t; \
using Name::item_size; \
@@ -112,6 +109,13 @@ struct hb_iter_t
using Name::operator -; \
static_assert (true, "")
/* Returns iterator type of a type. */
#define hb_iter_t(Iterable) decltype (hb_declval (Iterable).iter ())
template <typename T>
inline hb_iter_t (T)
hb_iter (const T& c) { return c.iter (); }
/* Mixin to fill in what the subclass doesn't provide. */
template <typename iter_t, typename item_t = typename iter_t::__item_t__>
struct hb_iter_mixin_t
+1 -1
View File
@@ -135,7 +135,7 @@ main (int argc, char **argv)
hb_array_t<hb_vector_t<int> > pa;
pa->as_array ();
+ s
+ hb_iter (s)
| hb_map (hb_identity)
| hb_filter ()
| hb_filter (hb_bool)