Challenge 1: A Hand-Written Move Constructor — Possible Solution ==================================================================== #include class Buffer { public: int *data; Buffer(int value) { data = new int(value); } Buffer(Buffer &&other) { data = other.data; other.data = nullptr; std::cout << "Moved" << std::endl; } ~Buffer() { delete data; } }; int main() { Buffer a(42); Buffer b = std::move(a); if (a.data == nullptr) { std::cout << "Source's pointer is now nullptr" << std::endl; } return 0; } Output: Moved Source's pointer is now nullptr WHY THIS WORKS AS AN ANSWER ------------------------------ std::move(a) casts a to an rvalue reference, causing the move constructor (not the implicit copy constructor) to be selected when constructing b -- the move constructor copies the pointer VALUE from a.data into b.data, then explicitly sets a.data to nullptr, exactly the chapter's own "steal and null out" pattern that prevents both a's and b's destructors from later trying to delete the same memory.