How about overload
struct Base {
template <typename T> void Method(T a) {
T b;
}
void Method(int a) {
float c;
}
};
struct Derived : public Base {
using Base::Method;
void Method(float a) {
float x;
}
};
Explicit specializations cannot be added as in your example. In addition, your base class is poorly formed, since you need to define any explicit specialization outside the scope of the class
struct Base {
template <typename T> void Method(T a) {
T b;
}
};
template <> void Base::Method<int>(int a) {
float c;
}
, , , . Derived, .