void SetCursor(const Cursor& value)
{
SetProperty(CursorProperty, _cursor, value);
}
static inline BindableProperty<UIElement, const Cursor&> CursorProperty =
BindableProperty<UIElement, const Cursor&>(&SetCursor);
template<typename TOwner, typename TField, typename TValue>
void SetProperty(BindableProperty<TOwner, TValue>& property, TField& field,
const std::remove_reference_t<TValue>& value)
{
// code
}
template<typename TOwner, typename TField, typename TValue>
void SetProperty(BindableProperty<TOwner, TValue>& property, TField& field, TValue value)
{
// code
}
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
};