← 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 →- Q1. Which of these is an rvalue?
- Q2. What does std::move(x) actually do?
- Q3. What does this print? (code)
- Q4. What should a move constructor do with the source object's pointer?
- Q5. Why should move constructors be marked noexcept?
- Q6. After Buffer c = std::move(a);, what can you safely do with a?
- Q7. What does this print? (code)
- Q8. Which list is the rule of five?
- Q9. What does this print? (code)
- Q10. Why is return std::move(local); a bad habit?