Just a small query regarding shared_ptr. Is it a good practice to use shared_ptr pointing to an array? For example, shared_ptr<int> sp(new int...
I have this code that doesn’t work, but I think the intent is clear: testmakeshared.cpp #include <memory> class A { public: static ::std::shared_ptr<A> ...
-
May 27, 2022
- 0 Comments
This question already has answers here: Closed 10 years ago. Possible Duplicates: pimpl: shared_ptr or unique_ptr smart pointers (boost) explained Could someone explain ...
-
May 16, 2022
- 0 Comments
When a function takes a shared_ptr (from boost or C++11 STL), are you passing it: by const reference: void foo(const shared_ptr<T>& p) or ...
-
May 14, 2022
- 0 Comments
std::shared_ptr<Object> p1 = std::make_shared<Object>("foo"); std::shared_ptr<Object> p2(new Object("foo")); Many google and stackoverflow posts are there on this, but I am not able to understand ...
-
May 12, 2022
- 0 Comments
I have a solid understanding of most OOP theory but the one thing that confuses me a lot is virtual destructors. I thought ...
-
April 11, 2022
- 0 Comments