提交 73c7a896 编写于 作者: B Behdad Esfahbod

[iter] Make hb_fill() and hb_copy() take iterators

I'm still going back and force...
上级 12e506fd
......@@ -44,19 +44,16 @@ struct array_iter_t : hb_iter_t<array_iter_t<T>, T>
hb_array_t<T> arr;
};
template <typename C, typename V> inline void
hb_fill (const C &c, const V &v)
template <typename I, typename V> inline void
hb_fill (hb_iter_t<I> i, const V &v)
{
for (typename C::iter_t i = c.iter (); i; i++)
for (; i; i++)
hb_assign (*i, v);
}
template <typename S, typename D> inline bool
hb_copy (const D &d, const S &s)
hb_copy (hb_iter_t<D> id, hb_iter_t<S> is)
{
typename S::iter_t is = s.iter ();
typename D::iter_t id = d.iter ();
for (; id && is; ++id, ++is)
*id = *is;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册