Sometimes I like my template class method definitions in a source file (or second header) to reduce build times. In all my source files I use a type alias for the class I'm defining the methods of to keep repetitions and typing time at a minimum.
Simple example:
// Foo.h
class Foo
{ void bar(); }
// Foo.cpp
using _ = Foo;
void _::bar()
{}
I have done this for template classes, which I want to keep the template parameter open of in method definitions, using MSVC.
// Foo.h
template<typename T>
class Foo
{ void bar(); }
// Foo.cpp
template<typename T>
using _ = Foo<T>;
template<typename T>
void _<T>::bar()
{}
However, while MSVC accepts this, GCC (12.2.0, MinGW) doesn't (invalid use of incomplete type
). Am I maybe just doing it the wrong way or is it just not possible?