#include <iostream> using namespace std; template <class T> class Foo { T x; public: Foo(T x); void show(); template <class TT> void func(T x, TT y); }; template <class T> Foo<T>::Foo(T x) : x(x) {} template <class T> void Foo<T>::show() { cout << x << endl; } template <class T> template <class TT> void Foo<T>::func(T _x, TT _y) { cout << _x << ' ' << _y << endl; } int main() { Foo<int> foo(10); foo.show(); foo.func(100, 'x'); foo.func(100, 1000); }