I have a base polymorphic class ( with virtual methods ) and a derived from it. I am trying to use the following code
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
Here is a code sample: class A { boost::mutex a_mutex; boost::shared_ptr<int> a; boost::shared_ptr<int> clone_a(void) {
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 :
This question already has answers here: Closed 11 years ago. 开发者_如何转开发 Possible Duplicate:
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
how to make friend function of std::make_shared(). I tried: class MyClass{ public: friend std::shared_ptr<MyClass> std::make_shared<MyClass>();
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
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
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