C++20 sections · 1024 units
Open in Course

Quiz: unique_ptr

Knowledge check

Check Your Understanding

What happens to p1 after auto p2 = std::move(p1);?

  1. A.p1 and p2 both point to the same object
  2. B.p1 becomes nullptr, p2 owns the object
  3. C.p1 is deleted, p2 owns a copy
  4. D.Compiler error, unique_ptr cannot be moved
Start the roadmap to answer the quizzes and solve the challenges