提交 f639b9a8 编写于 作者: B Behdad Esfahbod

[iter] Add hb_len() function-object

上级 a030ce4f
......@@ -145,6 +145,14 @@ static const struct
} hb_iter HB_UNUSED;
static const struct
{
template <typename T>
unsigned
operator () (T&& c) const
{ return hb_iter (c).len (); }
} hb_len HB_UNUSED;
/* Mixin to fill in what the subclass doesn't provide. */
template <typename iter_t, typename item_t = typename iter_t::__item_t__>
......
......@@ -158,6 +158,8 @@ main (int argc, char **argv)
| hb_drain
;
hb_len (src);
t << 1;
long vl;
s >> vl;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册