Template default arguments

前端 未结 4 1596
耶瑟儿~
耶瑟儿~ 2020-11-29 17:19

If I am allowed to do the following:

template 
class Foo{
};

Why am I not allowed to do the following in main?

4条回答
  •  庸人自扰
    2020-11-29 17:57

    You can use the following:

    Foo<> me;
    

    And have int be your template argument. The angular brackets are necessary and cannot be omitted.

提交回复
热议问题