Template Return Type with Default Value

前端 未结 6 1537
情歌与酒
情歌与酒 2021-02-10 20:46

So in writing a C++ template class, I have defined a method that returns an object of the templated type, as such:

template 
class Foo
{
public         


        
6条回答
  •  你的背包
    2021-02-10 21:48

    Indeed that's the standard way to solve the problem. I don't believe there should be any side effects to worry about in this case.

提交回复
热议问题