darray: don't zip over unequal ranges

This commit is contained in:
Danny Robson 2018-11-08 14:10:15 +11:00
parent 4489fff11c
commit 85a736b9f4

View File

@ -47,8 +47,9 @@ namespace cruft {
m_size (init.size ())
{
CHECK_LE (init.size (), CapacityV);
for (auto &&[src,dst]: cruft::zip (init, m_data.objects))
dst = std::move (src);
for (auto &&[idx, src]: cruft::izip (init))
m_data.objects[idx] = std::move (src);
}