I'm using boost's shared pointers, and enable_shared_from_this
to enable returning a shared pointer to this. Code looks like this:
class foo : public boost::enable_shared_from_this<foo>
{
boost::shared_ptr<foo> get()
{
return shared_from_this();
}
}
Why would shared_from_this throw a weak_ptr_cast exception?