void basic_flat_buffer<Allocator>:: copy_assign(basic_flat_buffer const& other, std::true_type) { max_ = other.max_; this->get() = other.get(); copy_from(other); }
void basic_flat_buffer<Allocator>:: swap(basic_flat_buffer& other, std::false_type) { BOOST_ASSERT(this->get() == other.get()); using std::swap; swap(max_, other.max_); swap(begin_, other.begin_); swap(in_, other.in_); swap(out_, other.out_); last_ = this->out_; other.last_ = other.out_; swap(end_, other.end_); }
basic_flat_buffer<Allocator>:: basic_flat_buffer(basic_flat_buffer const& other) : boost::empty_value<base_alloc_type>(boost::empty_init_t{}, alloc_traits::select_on_container_copy_construction( other.get())) , begin_(nullptr) , in_(nullptr) , out_(nullptr) , last_(nullptr) , end_(nullptr) , max_(other.max_) { copy_from(other); }
void basic_flat_buffer<Allocator>:: move_assign(basic_flat_buffer& other, std::false_type) { if(this->get() != other.get()) { copy_from(other); other.clear(); other.shrink_to_fit(); } else { move_assign(other, std::true_type{}); } }
void basic_flat_buffer<Allocator>:: move_assign(basic_flat_buffer& other, std::true_type) { clear(); shrink_to_fit(); this->get() = std::move(other.get()); begin_ = other.begin_; in_ = other.in_; out_ = other.out_; last_ = out_; end_ = other.end_; max_ = other.max_; other.begin_ = nullptr; other.in_ = nullptr; other.out_ = nullptr; other.last_ = nullptr; other.end_ = nullptr; }