Syntax of out-of-class definition of a template member function of a template class

≯℡__Kan透↙ 提交于 2021-02-07 11:50:33

问题


template<typename A, typename B>
class mindF_ck
{
    template<typename C>
    inline bool ouch(C & c_in);    
};

How do I define the signature for ouch out-of-class ? I send a query to my brain but it keeps coming up blank ;)


回答1:


template<typename A, typename B>
template<typename C>
bool mindf_uck<A,B>::ouch(C & c_in) {
}



回答2:


template <typename A, typename B>
  template <typename C>
bool mindf_ck<A, B>::ouch(C& c_in) {
    // ... code ...
}


来源:https://stackoverflow.com/questions/5895179/syntax-of-out-of-class-definition-of-a-template-member-function-of-a-template-cl

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!