I have a templated class A
The only thing you cannot do is use the typedef
to define the constructor. Other than that, you ought to specialize the A
constructor like this:
template<> A::A(int){}
If you want A
to have a different constructor than the generic A
, you need to specialize the whole A
class:
template<> class A {
public:
A(const string& takethistwentytimes) { cerr << "One Type" << std::endl; }
};