#include template class Demo { Type d_data; public: Demo(); Demo(Type const &value); void member1(); void member2(Type const &value); }; template Demo::Demo() : d_data(Type()) {} template void Demo::member1() { d_data += d_data; } // the following members should be commented out before // compiling for the 2nd time: template Demo::Demo(Type const &value) : d_data(value) {} template void Demo::member2(Type const &value) { d_data += value; } int main() { Demo demo; demo.member1(); }