15 Jan
2006
15 Jan
'06
2:02 a.m.
Jonathan Biggar wrote:
You can drop a definition of the shared pointer inside the template class:
template<typename T> class Foo { public:
typedef shared_ptr<Foo> Ptr;
};
and then you could refer to it as Foo<T>::Ptr, although you'd need to use "typename" in some circumstances.
And of course that won't work if you need to use the shared_ptr in contexts where Foo is not defined yet. -- Jonathan Biggar jon@levanta.com