E0070
говорит о том, что ты пробуешь пользоваться экземпляром определенного типа там, где этот тип еще не является полным.template<typename... TArgs>
using Action = Delegate<void(TArgs...)>;
template<typename TSender, std::derived_from<EventArgs> TEventArgs>
using EventHandler = Action<TSender&, const TEventArgs&>;
Event<EventHandler<Application, EventArgs>> e; // E0070
template<typename TSender, std::derived_from<EventArgs> TEventArgs>
using EventHandler = Delegate<void(TSender&, const TEventArgs&)>;
Event<EventHandler<Application, EventArgs>> e;
struct _EventArgs {};
template<typename... TArgs>
using _Action = std::function<void(TArgs...)>;
template<typename TSender, typename TEventArgs>
using _EventHandler = _Action<TSender, TEventArgs>;
template<typename T>
class _Event;
template<typename TSender, std::derived_from<_EventArgs> TEventArgs>
class _Event<_EventHandler<TSender, TEventArgs>>
{
};
_Event<_EventHandler<int, _EventArgs>> globalEvent; // Нет ошибки
void Test()
{
_Event<_EventHandler<int, _EventArgs>> localEvent; //E0070
}
struct TestStruct
{
_Event<_EventHandler<int, _EventArgs>> FieldEvent; //E0070
};