
1 Oct
2011
1 Oct
'11
6:17 p.m.
I inherited from enable_shared_from_this in my base class. When I called shared_from_this() in my derived class it throws an exception. When I go up the call stack I see that in the boost implementation weak_ptr is NULL and count is NULL.
I ensured the derived class was instatiated as a shared_ptr by using a fatory method.
If you create shared_ptr, as you described, and then call shared_from_this(), it should not throw exceptions. If it does, can you provide a trivial reproducing sample?