TITLE: Optional specification of template arguments PROBLEM: admin@rzaix13.uni-hamburg.de (Bernd Eggink) [ This is a paraphrase of the problem since I missed the original posting. Which of the following declarations is correct? template class Array { Array& func(); }; or template class Array { Array& func(); }; Which of the following definitions are correct? Array& func() { ... } or Array& func() { ... } ] RESPONSE: Alexander P. Zijdenbos , 25 Apr 94 To my knowledge, the type specifier is unnecessary within the class definition (see for instance Lippman, 2nd ed., pp 357). RESPONSE: jamshid@ses.com (Jamshid Afshar) I believe the ARM requires that the template arguments always be specified. ARM 14.7: template class task { //... friend task* prmpt(task*); // error }; The declaration of prmpt() is an error because there is no type task, only specific template types, task, task class List { public: List merge( const List& other ); // okay }; template List // error: must use List merge( const List& other ) // okay, parameter list in List scope {/*...*/} [...] If your compiler is Cfront-based, expect tons of template-related bugs. You should ask your compiler provider (eg, Sun, Centerline, etc.) to change their product to use the Edison Design Group front end. It's very correct (no "sorry, not implemented" errors) and probably does the best job of handling templates compared to any other current C++ compiler (even better than Watcom C++ or Borland C++ 4.0).