Dave wrote in news:10*************@news.supernews.com in comp.lang.c++:
template <class T>
class weak_ptr
{
weak_ptr(weak_ptr const &r);
};
In the code above, a parameter of type weak_ptr is declared. How is
this possible? weak_ptr is not a type, it's a template! How can me
use the name of a template as a data type?
In effect within the scope of weak_ptr< T > weak_ptr is an
alias for weak_ptr< T >.
I can't offhand remember the exact (standard text) of how this
is done, but it is.
IOW: That is how C++ is specified, the alternative would be:
template < typename T >
struct X
{
X< T >( X< T > const &x );
};
Which is just more typing, with no (AFAICT) percivable benefit.
Rob.
--
http://www.victim-prime.dsl.pipex.com/