Top "Shared-ptr" questions

Reference counted smart pointer class implementing shared ownership

NULL pointer with boost::shared_ptr?

What's the equivalent to the following: std::vector<Foo*> vec; vec.push_back(NULL); when dealing with boost::…

c++ boost null pointers shared-ptr
Passing shared pointers as arguments

If I declare an object wrapped in a shared pointer: std::shared_ptr<myClass> myClassObject(new myClass()); then …

c++ c++11 shared-ptr c++-faq
Passing shared_ptr<Derived> as shared_ptr<Base>

What is the best method to go about passing a shared_ptr of a derived type to a function that …

c++ casting c++11 shared-ptr smart-pointers
Problems using member function as custom deleter with std::shared_ptr

I'm trying to work out how to use std::shared_ptr with a custom deleter. Specifically, I'm using it with …

c++ sdl shared-ptr
std::shared_ptr of this

I am currently trying to learn how to use smart pointers. However while doing some experiments I discovered the following …

c++ this shared-ptr this-pointer
How to intentionally delete a boost::shared_ptr?

I have many boost::shared_ptr<MyClass> objects, and at some point I intentionally want to delete some …

c++ memory-management boost shared-ptr
std::shared_ptr thread safety

I've read that "Multiple threads can simultaneously read and write different shared_ptr objects, even when the objects are copies …

c++ std shared-ptr
shared_ptr and weak_ptr differences

I am reading Scott Meyers "Effective C++" book. It was mentioned that there are tr1::shared_ptr and tr1::weak_…

c++ c++11 shared-ptr weak-ptr cyclic-reference
C++ - passing references to std::shared_ptr or boost::shared_ptr

If I have a function that needs to work with a shared_ptr, wouldn't it be more efficient to pass …

c++ boost pass-by-reference pass-by-value shared-ptr
How to get the Object being pointed by a shared pointer?

I have a query. Can we get the object that a shared pointer points to directly? Or should we get …

c++ shared-ptr shared smart-pointers