mirror of
https://github.com/fmtlib/fmt.git
synced 2025-09-10 13:13:57 -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_) {
|
if (alloc_ != other.alloc_ && data != other.store_) {
|
||||||
size_t size = other.size(), capacity = other.capacity();
|
size_t size = other.size(), capacity = other.capacity();
|
||||||
// Perform copy operation, allocators are different
|
// Perform copy operation, allocators are different
|
||||||
this->reserve(size);
|
|
||||||
detail::copy<T>(data, data + size, this->data());
|
|
||||||
this->resize(size);
|
this->resize(size);
|
||||||
other.clear();
|
detail::copy<T>(data, data + size, this->data());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user