Since your class doesn't actually have a member AMethod
, you end up calling the member of the CRTP base, which gives you infinite recursion.
The simple solution is not to reuse names all over the place, but have one called AMethod
and the other AMethodImpl
or something like that:
void AMethod()
{
static_cast<T*>(this)->AMethodImpl();
}