I have the following code in a header file that does not belong to a class:
template<typename Foo> static const Compl<Foo,bar> *foobar (const FBTYPE &x);
template<> static const Compl<typea,bar> *foobar<typea>(const FBTYPE &x) {
return x.funcA();
}
template<> static const Compl<typeb,bar> *foobar<typeb>(const FBTYPE &x) {
return x.funcB();
}
The code compiles only with older versions of GCC, but in newer ones I get this error message:
rsvt.h(672): error
template<> static const Compl<typea,bar> *foobar<typea>(const FBTYPE &x) {
^
Any idea why it works with older versions of GCC, but not with newer ones? Also, how can I get it to work with GCC 5?
source
share