Sco*_*ord 12 c# c++ collections stl
我还在学习C#,并且惊讶地发现a List<T>更像是a而std::vector不是a std::list.有人可以根据STL描述所有C#集合(或者如果STL比较困难,标准概念数据类型与维基百科链接?我希望该引用将广泛有用.
最感兴趣的集合列表包括(随意添加其他集合):
编辑:我刚刚发现了一个可能感兴趣的类似问题:在stl C++和C#容器之间进行映射
Ste*_*ary 15
这是我发现的(忽略旧的非泛型集合):
Array- C数组,尽管.NET数组可以具有非零的起始索引.List<T> - std::vector<T>Dictionary<TKey, TValue> - unordered_map<Key, Data> HashSet<T> - unordered_set<Key>SortedDictionary<TKey, TValue> - std::map<Key, Data>SortedList<TKey, TValue>- 相当于a,std::vector<T>但在添加元素时使用二进制搜索+插入保持顺序.SortedSet<T> - std::set<Key>Queue<T> - std::queue<T>Stack<T> - std::stack<T>LinkedList<T> - std::list<T>从.NET集合值得注意的是失踪是"多"变体,例如multiset,multimap等等.然而,他们增加了一些非常有用的线程安全的集合:在"Concurrent-"变体,例如ConcurrentDictionary,ConcurrentQueue等等.