If I have a template class for which I define a member function later in the file, is there a way to avoid repeating a long list of parameters? for instance
template<class tempParam1, class tempParam2, class tempParam3> class Foo { ... int Bar(int funcParam1, int funcParam2, int funcParam3); } template<class tempParam1, class tempParam2, class tempParam3> int Foo<tempParam1, tempParam2, tempParam3>::Bar(int funcParam1, int funcParam2, int funcParam3) { ... }
Is there a way for the line of definition of this function to be so long? With many methods to determine, this makes my code hard to read.
I tried typedef like
template<class tempParam1, class tempParam2, class tempParam3> typedef Foo<tempParam1, tempParam2, tempParam3> FooClass; int FooClass::Bar(int funcParam1, int funcParam2, int funcParam3) { ... }
But the compiler (g ++) complained ("error: declaring the template" typedef ").
Thanks!
source share