Medium
Let std::vector move elements during reallocation
Fill in the blank so that when a std::vector<Buffer> reallocates, it moves existing elements into the new storage instead of copying them.
main.cpp
class Buffer {public: Buffer(Buffer&& other) : data_(other.data_), size_(other.size_) { other.data_ = nullptr; } ~Buffer() { delete[] data_; }private: int* data_; size_t size_;};102 of 117 in C++