Given a C++ class:
template<typename T>
class A {
public:
int a;
T x;
int getA() {return a;}
};
Is it possible for a template specialization to 'inherit' (without actual C++ inheritance) members like a and getA() from A? Furthermore, when writing code that does a lot of template specializations for classes, should I type the same code many times (which kinda defeats the whole purpose of templates), or restructure the class so that it accommodates for the specializations (e.g. by encapsulating another template class member inside so that specializations are limited to that class only)?