在C++/CLI中,似乎没有对System命名空间中的Action和Func委托提供支持。至少不支持多个泛型参数,例如:
System::Action<int, int>^ action = nullptr;
System::Func<int, int>^ func = nullptr;
两者都会导致错误,例如:
error C2977: 'System::Action' : too many generic arguments
error C2955: 'System::Action' : use of class generic requires generic argument list
只有单个参数的Action有效:
System::Action<int>^ action = nullptr;
有人知道为什么或者缺少什么才能使这个工作起来吗?我正在使用Visual Studio 2008,项目的目标框架是3.5。