
4 Mar
2009
4 Mar
'09
8:03 p.m.
Rob Currey:
template<class X> class Y: public enable_shared_from_this< Y<X> > { public:
shared_ptr< Y<X> > f() { return shared_from_this();
In a template, you need return this->shared_from_this(); to inform the compiler that shared_from_this will come from a base class.
} };