[iter] Accept pointer in hb_iter() and hb_iter_t()
This commit is contained in:
parent
c93eeba9b2
commit
cdb61eb043
@ -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. */
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user