🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Move Semantics and rvalue References: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. Which of these is an rvalue?
  2. Q2. What does std::move(x) actually do?
  3. Q3. What does this print? (code)
  4. Q4. What should a move constructor do with the source object's pointer?
  5. Q5. Why should move constructors be marked noexcept?
  6. Q6. After Buffer c = std::move(a);, what can you safely do with a?
  7. Q7. What does this print? (code)
  8. Q8. Which list is the rule of five?
  9. Q9. What does this print? (code)
  10. Q10. Why is return std::move(local); a bad habit?