C++ template partial specialization with inheritance
问题 I need partial specialization of the struct , but I'd like also use some common functionality. For example, suppose I have the next type: template <typename A, typename B> struct Foo { Foo& func0() { /* common actions with A and B */; return *this; } void func1() { /* common actions with A and B */ } void func2() { /* common actions with A and B */ } } Then I want specialize it for one of the template parameters - for example, I want consider special case when B is int , and I want to