template<typename T>struct Foo{ T bar; void doSomething(T param) {/* do stuff using T */}};// somewhere in a .cppFoo<int> f;