Pat Mustard Pat Mustard - 3 months ago 30
C# Question

C# List of Dictionary

I want to map some C++ to C# via CLI/C++. In C++ I have a

vector<map<string,string>>
which I thought I could represent in .Net as
List<Dictionary<String,String>
. However, this gives me errors.

List<Dictionary<String,String>> // is not a valid generic argument


Is there a standard alternative?

Note I'm implementing this in CLI/C++.

Answer

It turns out that I need to pass handles to generic containers:

List<Dictionary<String^, String^>^>^ list_of_dict_of_string;

Thanks, all.

Comments