提交 7557e348 编写于 作者: B Behdad Esfahbod

[iter] Move hb_fill() and hb_copy() to hb-iter.hh

上级 5e1840e0
......@@ -113,4 +113,22 @@ struct hb_iter_t
};
/* Functions operating on iterators or iteratables. */
template <typename C, typename V> inline void
hb_fill (const C& c, const V &v)
{
for (typename C::iter_t i (c); i; i++)
hb_assign (*i, v);
}
template <typename S, typename D> inline bool
hb_copy (hb_iter_t<D> &id, hb_iter_t<S> &is)
{
for (; id && is; ++id, ++is)
*id = *is;
return !is;
}
#endif /* HB_ITER_HH */
......@@ -59,22 +59,6 @@ struct some_array_t
hb_array_t<T> arr;
};
template <typename C, typename V> inline void
hb_fill (const C& c, const V &v)
{
for (typename C::iter_t i (c); i; i++)
hb_assign (*i, v);
}
template <typename S, typename D> inline bool
hb_copy (hb_iter_t<D> &id, hb_iter_t<S> &is)
{
for (; id && is; ++id, ++is)
*id = *is;
return !is;
}
int
main (int argc, char **argv)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册