shared-ptr
shared_pointer of a base class cannot be created using a polymorphic derived
I have a base polymorphic class ( with virtual methods ) and a derived from it. I am trying to use the following code[详细]
2023-04-12 10:51 分类:问答C++ destruction list
I have a class to do a computation using some callbacks. those callbacks need to allocate data (dynamic arrays) that needs to live outside of the callback scope but not after the cla开发者_JAVA百科ss[详细]
2023-04-11 12:26 分类:问答Is it safe to return by value a shared_ptr that is guarded by mutex?
Here is a code sample: class A { boost::mutex a_mutex; boost::shared_ptr<int> a; boost::shared_ptr<int> clone_a(void) {[详细]
2023-04-11 11:04 分类:问答Different templated class in a set using boost::shared_ptr
I have some design problems, I thought one of you might have some clue to help me. I tried to summarize my problem to this simple example :[详细]
2023-04-10 08:45 分类:问答shared_ptr release [duplicate]
This question already has answers here: Closed 11 years ago. 开发者_如何转开发 Possible Duplicate:[详细]
2023-04-10 03:08 分类:问答A weak/shared pointer, detect when one user remains, boost
I want a pointer where I can tell when the reference count is one. Essentially the pointer works like a weak_ptr, but the cleanup needs to be manual. That is, every so often the program goes through a[详细]
2023-04-08 10:09 分类:问答friend function of std::make_shared() in Visual Studio 2010 (not Boost)
how to make friend function of std::make_shared(). I tried: class MyClass{ public: friend std::shared_ptr<MyClass> std::make_shared<MyClass>();[详细]
2023-04-07 00:55 分类:问答boost shared_ptr get owner count
I\'m using boost::shared_ptr to store a pointer to texture. I\'m loading new textures as i need and share them among the program using shared_ptr. If my app is using too much memory i want to remove u[详细]
2023-04-06 22:38 分类:问答Creating a shared_ptr from an allocator using typedefs?
I have some code that I am retrofitting to use an alloc开发者_如何学运维ator instead of operator new and operator delete directly.One part of this code\'s public interface is to return not a bald poin[详细]
2023-04-05 10:08 分类:问答What is the deal with shared pointer?
My program fails due to addition of a pointer to a vector. After much reading and deletin开发者_如何学运维g I have changed it to an addition of a shared pointer into a set (using insert) which was fin[详细]
2023-04-05 01:36 分类:问答