S

Shiva Ram • 30.44K Points
Instructor I

Q. Which of the following is the correct way to define a move constructor in C++?

  • (A) MyClass(MyClass&& other) { }
  • (B) MyClass(MyClass& other) { }
  • (C) Both A and B
  • (D) None of the above
  • Correct Answer - Option(A)
  • Views: 57
  • Filed under category C++

Explanation by: Shiva Ram
The correct way to define a move constructor is 'MyClass(MyClass&& other) { }'.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics