g++
11.3.0 can't compile this code:
template <typename T>
class Foo {
public:
Foo<T>() {}
};
Error is
expected unqualified-id before ‘)’ token
One way to fix it is correcting Foo<T>
to Foo
because modern versions of g++
can understand template class methods inside the class without a template parameter.
But code like this could be compiled in earlier versions of g++
.
Manual code fixing is an inconvenient way because some open source dependencies like websocketcpp contain plenty of code like this, it's very inconvenient to make your own forks and fix all code.
So, I suggest there is a flag or some pragma in g++
which may help to work around this problem. Is there some work around here without code fixing?