Bri*_*ian 4 .net generics managed-c++ .net-2.0
我想在托管 C++ 项目中创建KeyValuePair的列表。这是我正在使用的语法
List<KeyValuePair<String^, String^>^>^ thing;
Run Code Online (Sandbox Code Playgroud)
但我收到以下错误:
错误 C3225:“T”的泛型类型参数不能是“System::Collections::Generic::KeyValuePair ^”,它必须是值类型或引用类型的句柄
我基本上想这样做(C#)
List<KeyValuePair<string, string>> thing;
Run Code Online (Sandbox Code Playgroud)
但在托管 C++ 中。哦,在 .Net 2.0 中。有接受者吗?
弄清楚了:
List<KeyValuePair<String^, String^>>^ thing;
Run Code Online (Sandbox Code Playgroud)
KeyValuePair 本身不需要是句柄。呃。
归档时间: |
|
查看次数: |
5501 次 |
最近记录: |