[iter] Accept pointer in hb_iter() and hb_iter_t()

This commit is contained in:
Behdad Esfahbod committed 2019-05-08 11:00:18 -07:00
1 parent c93eeba9b2
commit cdb61eb043
2 files changed
+5 -2

No files matched your search

+2 -2
View File
@@ -148,7 +148,7 @@ struct hb_iter_t
static_assert (true, "")
/* Returns iterator type of a type. */
#define hb_iter_t(Iterable) decltype (hb_declval (Iterable).iter ())
#define hb_iter_t(Iterable) decltype (hb_deref (hb_declval (Iterable)).iter ())
template <typename> struct hb_array_t;
@@ -158,7 +158,7 @@ struct
template <typename T>
hb_iter_t (T)
operator () (T&& c) const
{ return c.iter (); }
{ return hb_deref (hb_forward<T> (c)).iter (); }
/* Specialization for C arrays. */
+3
View File
@@ -179,6 +179,9 @@ main (int argc, char **argv)
hb_map_t m;
hb_iter (st);
hb_iter (&st);
+ hb_iter (src)
| hb_map (m)
| hb_map (&m)