Template Return Type with Default Value

前端 未结 6 1591
情歌与酒
情歌与酒 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:46

    Sounds OK, if the class has no copy constructor, you will not be able to return it anyway.

提交回复
热议问题