Top "Shared-ptr" questions

Reference counted smart pointer class implementing shared ownership

When to use virtual destructors?

I have a solid understanding of most OOP theory but the one thing that confuses me a lot is virtual …

c++ polymorphism shared-ptr virtual-destructor
Differences between unique_ptr and shared_ptr

Possible Duplicates: pimpl: shared_ptr or unique_ptr smart pointers (boost) explained Could someone explain differences between shared_ptr and …

c++ pointers c++11 shared-ptr unique-ptr
Error: expected type-specifier before 'ClassName'

shared_ptr<Shape> circle(new Circle(Vec2f(0, 0), 0.1, Vec3f(1, 0, 0))); shared_ptr<Shape> rect(new Rect2…

c++ shared-ptr pure-virtual
Example to use shared_ptr?

Hi I asked a question today about How to insert different types of objects in the same vector array and …

c++ boost vector shared-ptr smart-pointers
When is std::weak_ptr useful?

I started studying smart pointers of C++11 and I don't see any useful use of std::weak_ptr. Can someone …

c++11 shared-ptr weak-ptr c++-faq
Should we pass a shared_ptr by reference or by value?

When a function takes a shared_ptr (from boost or C++11 STL), are you passing it: by const reference: void …

c++ c++11 boost shared-ptr
Difference in make_shared and normal shared_ptr in C++

std::shared_ptr<Object> p1 = std::make_shared<Object>("foo"); std::shared_ptr<Object> …

c++ c++11 shared-ptr
Where is shared_ptr?

I am so frustrated right now after several hours trying to find where shared_ptr is located. None of the …

c++ boost c++11 shared-ptr smart-pointers
shared_ptr to an array : should it be used?

Just a small query regarding shared_ptr. Is it a good practice to use shared_ptr pointing to an array? …

c++ c++11 shared-ptr
Should I pass a shared_ptr by reference?

What are the best practices for passing a shared_ptr? Currently I pass shared_ptr function arguments like so: void …

c++ shared-ptr