fix resizing error in allocator_move_impl

This commit is contained in:
Murat Toprak 2025-07-31 23:28:17 +03:00
parent b15bbdcb23
commit 2c307e2839

View File

@ -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;