
20 Aug
2009
20 Aug
'09
8:50 a.m.
typedef MyClass<P1> me; typedef boost::shared_ptr<me> pointer;
so, later everything will depend on "me", for example: return pointer(new me); Also, this code could be reused when creating other classes.
Note that this is not necessary: template <typename T> struct Foo { Foo foobar (); }; template <typename T> Foo<T> Foo<T>::foobar () { return Foo(); // << referred to Foo<T> implicitly } int main () { Foo<void> foo; Foo<void> phoo = foo.foobar(); } Inside the class declaration and inside corpora of member functions, the unqualified class name is an alias for the qualified one. Or did I misunderstood something? Sebastian Mach http://phresnel.org