LearnFrenzy
Sign in Take a free test

Move Semantics · Move Semantics MCQ · Question 3

Signature of a move constructor Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
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!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links