If I have a template class, for which I define a member function later in the file, is there a way to avoid repeating the long parameter list? For example
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 some way to keep that function definition line from being so long? Having a bunch of methods to define like that is making my code hard to read.
I tried a 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: template declaration of ‘typedef’").
Thanks!