zoukankan      html  css  js  c++  java
  • C++和.net的集合类对应

     

    Here's what I've found (ignoring the old non-generic collections):

    • Array - C array, though the .NET Array can have a non-zero starting index.
    • 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> - equivalent to a std::vector<T> but keeping it ordered by using binary search + insert when adding elements.
    • SortedSet<T> - std::set<Key>
    • Queue<T> - std::queue<T>
    • Stack<T> - std::stack<T>
    • LinkedList<T> - std::list<T>

    Notably missing from the .NET collections are the "multi-" variants, e.g., multisetmultimap, etc. However, they have added a number of very useful threadsafe collections: the "Concurrent-" variants, e.g., ConcurrentDictionaryConcurrentQueue, etc.

  • 相关阅读:
    Codeforces Round #319 (Div. 2) D
    因为网络请求是 异步的,
    ios真蛋疼,
    单例模式的两种实现,
    jump, jump,
    一点 误删,
    关于代理,
    button上的两个手势,
    数据,
    header 的蓝色,
  • 原文地址:https://www.cnblogs.com/time-is-life/p/5638881.html
Copyright © 2011-2022 走看看