mirror of
https://github.com/fmtlib/fmt.git
synced 2025-09-08 12:02:51 -04:00
fix resizing error in allocator_move_impl
This commit is contained in:
parent
b15bbdcb23
commit
2c307e2839
@ -853,10 +853,8 @@ class basic_memory_buffer : public detail::buffer<T> {
|
||||
if (alloc_ != other.alloc_ && data != other.store_) {
|
||||
size_t size = other.size(), capacity = other.capacity();
|
||||
// Perform copy operation, allocators are different
|
||||
this->reserve(size);
|
||||
detail::copy<T>(data, data + size, this->data());
|
||||
this->resize(size);
|
||||
other.clear();
|
||||
detail::copy<T>(data, data + size, this->data());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user