C++20 sections · 1024 units
Open in CourseQuiz: unique_ptr
Knowledge check
Check Your Understanding
What happens to p1 after auto p2 = std::move(p1);?
- A.p1 and p2 both point to the same object
- B.p1 becomes nullptr, p2 owns the object
- C.p1 is deleted, p2 owns a copy
- D.Compiler error, unique_ptr cannot be moved