“template<>” vs “template” without brackets - what's the difference?

后端 未结 2 1642
情话喂你
情话喂你 2020-12-02 15:16

Suppose I\'ve declared:

template  void foo(T& t);

Now, what is the difference between

template <&         


        
2条回答
  •  猫巷女王i
    2020-12-02 15:47

    With class/struct,

    template  struct foo {};
    

    Following is a specialization:

    template <> struct foo{};
    

    Following is an explicit instantiation:

    template struct foo;
    

提交回复
热议问题