This is because inside the body of the Test<Writer> class, naming Test without providing template arguments automatically takes the same arguments (e.g., Writer ).
For example, this allows you to write a copy constructor as:
Test(const Test&);
instead
Test::Test(const Test<Writer>&);
You can overcome this by assigning Test your namespace, for example
typedef TestHelper< ::Test > Helper;
NOTE. As Tomalek suggests, the original use is valid in C ++ 0x. Here is the relevant section of the standard (shock), from section 14.6.1 ( [temp.local] ):
Like regular (non-template) classes, class templates have a name with the class introduced (section 9). The name of the entered class can be used as a template name or type name. When used with a list -argument-template , as a template argument for a template-template or as a final identifier in a specified qualifier of the type declaration template, the class of friends refers to the class template itself . Otherwise, this is equivalent to the template name, followed by the template parameters of the class template enclosed in <>.
Ben voigt
source share