Which of the following smart pointers does not take ownership of the pointed object?
- unique_ptr
- shared_ptr
- weak_ptr
- auto_ptr
weak_ptr is a smart pointer that holds a non-owning reference to an object managed by shared_ptr. It doesn't affect the reference count and won't prevent the object from being deleted.
Loading...
Related Quiz
- The concept of encapsulation involves bundling the data () and the methods () that operate on the data into a single unit.
- What is the impact of a function having a default argument?
- You are tasked with optimizing a piece of code containing nested loops...
- The _______ operator is used to compare whether two C++ values are not equal.
- The first commercially available C++ compiler was named _______.