C++ Template - Multiple types

前端 未结 3 1032
旧时难觅i
旧时难觅i 2021-01-30 17:08

consider the following class template:

template 
class MyClass
{
   void MyFunc();
};

template 
void MyClass::MyFunc()
{
          


        
3条回答
  •  北海茫月
    2021-01-30 17:34

    template 
    template  
    void MyClass::MyFunc2(T2* pData) 
    { 
      //...implementation goes here 
    }
    

    EDIT 2:

    $14.5.2/1 - "A template can be declared within a class or class template; such a template is called a member template. A member template can be defined within or outside its class definition or class template definition. A member template of a class template that is defined outside of its class template definition shall be specified with the template-parameters of the class template followed by the template-parameters of the member template."

提交回复
热议问题