Move data from other to this buffer.
| 654 | private: |
| 655 | // Move data from other to this buffer. |
| 656 | void move(basic_memory_buffer& other) { |
| 657 | Allocator &this_alloc = *this, &other_alloc = other; |
| 658 | this_alloc = std::move(other_alloc); |
| 659 | T* data = other.data(); |
| 660 | std::size_t size = other.size(), capacity = other.capacity(); |
| 661 | if (data == other.store_) { |
| 662 | this->set(store_, capacity); |
| 663 | std::uninitialized_copy(other.store_, other.store_ + size, |
| 664 | internal::make_checked(store_, capacity)); |
| 665 | } else { |
| 666 | this->set(data, capacity); |
| 667 | // Set pointer to the inline array so that delete is not called |
| 668 | // when deallocating. |
| 669 | other.set(other.store_, 0); |
| 670 | } |
| 671 | this->resize(size); |
| 672 | } |
| 673 | |
| 674 | public: |
| 675 | /** |