Question 3
Back to Exercise
Which is the usual signature of a move constructor for class Buffer?
- A Buffer(const Buffer& o);
- B Buffer(Buffer&& o) noexcept; Correct
- C Buffer(Buffer o);
- D Buffer& move(Buffer o);
Correct Answer: Option B
It takes a non-const rvalue reference because it modifies (empties) the source.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!