unordered-map

    5熱度

    3回答

    unordered_map我使用被包括作爲unordered_map: #include <unordered_map> 並且程序如下編譯: g++ Test.cc -std=gnu++0x -o test 我使用TR1的unordered_map或的C++ 0x的。或者它們都是一樣的?

    0熱度

    4回答

    我試圖插入與一個std ::設定值的unordered_map宣佈爲: class Database { ... private: struct CountryRCID { int RCID; int Vote; }; struct comp { bool operator() (const CountryRCID& left,

    6熱度

    5回答

    我一直在編寫圖像處理算法,並且在某些時候我需要收集一些有關轉換像素的統計信息,以獲得更多關於我應該跟隨進一步開發的方向的更多信息。我需要收集什麼信息是格式爲: key: RGB value value: int 我做了什麼,被我打開轉換後的圖像,並通過它迭代,節省了我需要std::unordered_map具有以下特徵值: typedef std::unordered_map<boost::

    0熱度

    1回答

    我有下面的代碼,我想消除我創建初始值爲10的元素。我在設置迭代器和擦除它時遇到問題。它是如何完成的? #include <iostream> #include <boost/unordered_map.hpp> using namespace std; int main() { typedef boost::unordered_map<int, boost::unordere

    0熱度

    1回答

    我在應用程序中有一些靜態unordered_maps,我希望能夠在啓動時進行初始化。他們不是一個班級的一部分。在我的初始設置,頁眉和源文件如下: namespace Game { namespace Elements { enum Element { Air = 1, Dark = 2, Earth = 4,

    1熱度

    3回答

    我想使用迭代器輸出一個多層unordered_map中的整數,我遇到了麻煩,錯誤是在代碼下面。下面 #include <boost/unordered_map.hpp> #include <iostream> using namespace std; int main() { typedef boost::unordered_map <int, boost::unordere

    2熱度

    1回答

    std :: tr1 :: unordered_map是否存在爲std :: map存在的相等(==)運算符 的原因? 什麼是一個很好的實現方法?我正在考慮創建兩組unordered_map :: value_type,從兩個hash_maps初始化它們,然後檢查兩個集合是否相等。

    4熱度

    6回答

    #include <iostream> #include <string> #include <unordered_map> using namespace std; int main() { unordered_map< int, string > m; m[1] = "one"; m[2] = "two"; m[4] = "four";

    2熱度

    1回答

    我有關於unordered_map的自定義分配器的一些問題。我有一個很大的數據集,我需要將字符串散列爲鍵。所以我開始知道提供一個自定義的內存分配器可以優化速度。但我該怎麼做? (我檢查過,但我找不到有關使用自定義分配器的任何信息,儘管有一些與定製哈希函數等有關的東西) 另外unordered_map :: size()返回什麼?它說它是最長的受控序列。我對這意味着什麼感到困惑。它是桶本身的數量還是

    18熱度

    5回答

    我正在使用來自gnu ++ 0x的unordered_map來存儲大量數據。我想爲大量元素預先分配空間,因爲我可以限制使用的總空間。 我想什麼能夠做的就是調用: std::unordered_map m; m.resize(pow(2,x)); 其中x是已知的。 unordered_map不支持此操作。如果可能,我寧願使用unordered_map,因爲它最終將成爲標準的一部分。 一些其他方