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.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *