What is C# equivalent of <map> in C++?
The equivalent would be class SortedDictionary<TKey, TValue>
in the System.Collections.Generic
namespace.
If you don't care about the order the class Dictionary<TKey, TValue>
in the System.Collections.Generic
namespace would probably be sufficient.
std::map<Key, Value>
→ SortedDictionary<TKey, TValue>
std::unordered_map<Key, Value>
→ Dictionary<TKey, TValue>
Take a look at the Dictionary class in System::Collections::Generic.
Dictionary<myComplex, int> myMap = new Dictionary<myComplex, int>();