#include template class One { public: One() {} ~One() {} void fn() { std::cout << "One: primary" << std::endl; } private: T _t; }; template<> class One { public: One() {} ~One() {} void fn() { std::cout << "One: specialization" << std::endl; } private: char _c; }; template class Two { public: Two() {} ~Two() {} void fn() { std::cout << "Two: primary" << std::endl; } private: T1 _t1; T2 _t2; }; template class Two { public: Two() {} ~Two() {} void fn() { std::cout << "Two: specialization" << std::endl; } private: T _t; char _c; }; template class Two { public: Two() {} ~Two() {} void fn() { std::cout << "Two: specialization" << std::endl; } private: T _t; T* _pt; }; template class Two { public: Two() {} ~Two() {} void fn() { std::cout << "Two: specialization" << std::endl; } private: T _t; }; template class Two { public: Two() {} ~Two() {} void fn() { std::cout << "Two: specialization" << std::endl; } private: T _t; }; template<> class Two { public: Two() {} ~Two() {} void fn() { std::cout << "Two: specialization" << std::endl; } private: char _c; }; template<> class Two { public: Two() {} ~Two() {} void fn() { std::cout << "Two: specialization" << std::endl; } private: char _c; }; template<> class Two { public: Two() {} ~Two() {} void fn() { std::cout << "Two: specialization" << std::endl; } private: char _c; }; int main() { One oneInt; oneInt.fn(); One oneChar; oneChar.fn(); Two twoIntInt; twoIntInt.fn(); Two twoIntChar; twoIntChar.fn(); Two twoIntIntP; twoIntIntP.fn(); Two twoIntIntR; twoIntIntR.fn(); Two twoIntIntA; twoIntIntA.fn(); Two twoCharCharP; twoCharCharP.fn(); Two twoCharCharR; twoCharCharR.fn(); Two twoCharCharA; twoCharCharA.fn(); return 0; }