MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / move

Method move

extlibs/fmt/include/fmt/format.h:656–672  ·  view source on GitHub ↗

Move data from other to this buffer.

Source from the content-addressed store, hash-verified

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 /**

Callers

nothing calls this directly

Calls 6

make_checkedFunction · 0.85
capacityMethod · 0.80
resizeMethod · 0.80
dataMethod · 0.45
sizeMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected