Replaced size() with std::distance.

This commit is contained in:
Takatoshi Kondo 2014-08-11 07:48:30 +09:00
parent ea23bf843e
commit e18102d16f

View File

@ -55,7 +55,8 @@ inline void operator<< (object::with_zone& o, const std::forward_list<T>& v)
o.via.array.ptr = nullptr;
o.via.array.size = 0;
} else {
object* p = static_cast<object*>(o.zone->allocate_align(sizeof(object)*v.size()));
object* p = static_cast<object*>(
o.zone->allocate_align(sizeof(object)*std::distance(v.begin(), v.end())));
for(auto const& e : v) *p++ = object(e, o.zone);
}
}