*i = v;
}
-template <typename S, typename D,
- hb_enable_if (hb_is_iterator (S) && hb_is_iterator (D))>
-inline bool
-hb_copy (D id, S is)
+template <typename S, typename D>
+inline void
+hb_copy (D&& id, S&& is)
{
- for (; id && is; ++id, ++is)
- *id = *is;
- return !is;
+ hb_iter (id) | hb_sink (is);
}
{
init ();
alloc (o.length);
- hb_iter (o) | hb_sink (this);
+ hb_copy (o, *this);
}
hb_vector_t (hb_vector_t &&o)
{
{
reset ();
alloc (o.length);
- hb_iter (o) | hb_sink (this);
+ hb_copy (o, *this);
return *this;
}
hb_vector_t& operator = (hb_vector_t &&o)