mirror of
https://github.com/msgpack/msgpack-c
synced 2026-06-08 16:11:40 +00:00
Replaced size() with std::distance.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user