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

I'm still going back and force...
This commit is contained in:
Behdad Esfahbod 2018-12-21 02:48:28 -05:00
parent 12e506fda4
commit 73c7a896d1
1 changed files with 4 additions and 7 deletions

View File

@ -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;