I\'m trying to use boost::shared_ptr and boost::enable_shared_from_this to no avail. It looks as if shared_from_this() is returning the wrong shared_ptr. Here is what I see:
class Obj_A { public: ~Ojb_A() { cout << \"calling Obj_A() destructor\\n\"; } void method1() { cout << \"invoking Obj_A::method1()\\n\";
Are there any difference between tr1::shared_ptr and boost::shared_ptr? If so, what开发者_运维技巧?No, the documentation of boost shared_ptr says:
I\'m working on a couple of classes and I\'m wondering how I can use a normal member in my application class, where the member needs to use shared_from_this()?
I wanted to make a special version of shared_ptr that would perform specific operations when it was created or destroyed, but my plans appear to be foiled by the realization that shared_ptr\'sdestruct
As a personal exercise, I want to implement the visitor pattern using shared_ptr.I am familiar with Robert Martin\'s acyclic visitor paper but find the intrusive nature of the virtual accept() and nec
If I have a class with a private construction, using boost::make_shared() to construct a shared_ptr of that class from within a member function of that class will issue a compiler error using gcc 4.6.
When comparing two variants of pointers—classic vs. shared_ptr—I was surprised by a significant increase of the running speed of the program. For testing 2D Delaunay incremental Insertion
Common pointers allows you to create pointer to pointer: void foo(Object **o) {} int main() { Object * o = new Object();
I have a fairly complex multi threaded application (server) that from time to time will crash due to an assert: