C++ template specialization of constructor

后端 未结 7 997
醉话见心
醉话见心 2021-02-05 17:15

I have a templated class A and two typedefs A and A. How do I override the constructor for A ? The following does not wor

7条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-05 17:39

    How about :

    template 20) >
    class A {
    public:
      A(int m){
          // this is true
      }
    
    };
    
    template
    class A {
    public:
        A(int m) {
        //something else
        }
    };
    

提交回复
热议问题