Template Return Type with Default Value

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

    Boost addresses this problem in one of its utility template classes, namely boost::value_initialized and its relatives.

提交回复
热议问题