What is the meaning of template<> with empty angle brackets in C++?

后端 未结 3 1883
悲哀的现实
悲哀的现实 2020-12-04 19:33
template<>
class A{
//some class data
};

I have seen this kind of code many times. what is the use of template<> in the ab

3条回答
  •  无人及你
    2020-12-04 19:47

    Doesn't look right. Now, you might have instead written:

    template<>
    class A {
    // some stuff
    };
    

    ... which would be a template specialisation for type foo.

提交回复
热议问题