compiler: cpp: use generation-time parent classes instead of CRTP