Topic: Templates and member functions


Author: wikman@king.trs.ntc.nokia.com
Date: 21 Apr 94 13:57:41
Raw View
Hi,

Consider this:

template<class T>
class Class
{
  public:
    void print();
};

template<class T>
void Class::print()
{
  cout << "default print called";
}

Class<int>::print()
{
  cout << "print specialized for int called";
}


Is this legal C++? The ARM doesn't mention it, but atleast USL SC
uses it and cfront and Borland accepts it.

 Johan

--
--
Johan Wikman
wikman@ntc.nokia.com; C=FI,A=Elisa,P=Nokia Telecom,S=Wikman,Gi=Johan
TL4E - P.P. Box 12, SF-02611 Espoo 61, Finland