← Move Semantics: rvalue References & std::move

Add a Move Constructor

easy

std::move(a) makes Buffer b = std::move(a); select the move constructor instead of the copy constructor – your job is to make that constructor actually steal, not duplicate.

If your move constructor is missing or wrong (say, it still allocates a fresh array and copies, like a copy constructor would), b.data will be a different address from a’s original pointer, and a.data will still hold its original, non-null value – both checks in main exist specifically to catch that.

Your solution

"Run" uses the sample stdin ("5"). "Submit" checks your code against all 3 test cases.

Test results

Submit your solution to run it against all test cases.

Hints

    Reference solution