How to create a template function within a class? (C++)

后端 未结 4 1706
粉色の甜心
粉色の甜心 2020-11-30 16:45

I know it\'s possible to make a template function:

template
void DoSomeThing(T x){}

and it\'s possible to make a template

4条回答
  •  暖寄归人
    2020-11-30 17:19

    Yes, template member functions are perfectly legal and useful on numerous occasions.

    The only caveat is that template member functions cannot be virtual.

提交回复
热议问题