• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            隨筆 - 6  文章 - 8  trackbacks - 0
            <2025年8月>
            272829303112
            3456789
            10111213141516
            17181920212223
            24252627282930
            31123456

            常用鏈接

            留言簿(1)

            隨筆檔案

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            剛剛裝上VC8,發(fā)現(xiàn)VC8現(xiàn)在也支持hash_map了,終于可以不用STLPort了(不是不想用,而是在VC里面用太TNND麻煩了)。不過VC8上的hash-map還是有不爽的地方 1。它定義在stdext namespace 中 2。它需要至少specialize兩個template來添加自定義類。。。不過終究還是算不小的的進步啦;D =====================================


            ============ VC2005 ================
            // test.cpp : Defines the entry point for the console application.
            //

            #include "stdafx.h"
            #include
            #include
            #include

            struct Key{
              int i;
            };


            namespace std {
              template <> struct less<::Key>
               : public binary_function<::Key, ::Key, bool>
              {
                bool operator()(const ::Key& _Left, const ::Key& _Right) const
                { // apply operator< to operands
                  return (_Left.i < _Right.i);
                }
              };
            }

            namespace stdext {
              template <> size_t hash_value(const Key &key){
                return hash_value(key.i);
              }
            }

            int _tmain(int argc, _TCHAR* argv[])
            {
              stdext::hash_map testmap; 
              Key k;
              k.i = 1;
              testmap[k] = std::string("hello, world");
              testmap[k] = std::string("hello, again");

              std::cout << "size of map: " << testmap.size() << std::endl;
              return 0;
            }

            ============GCC + STLPort ===========
            struct Key {
              ...
            };


            namespace std {
              template <> struct hash {
                size_t operator()(const Key &key) const {
                    ...
                };
              }
            }


            int main()
            {
              ...
            }

            posted on 2007-04-03 14:01 Neal 閱讀(2025) 評論(1)  編輯 收藏 引用

            FeedBack:
            # re: VC8 的 hash_map 2007-04-05 08:59 
            VC7里面一樣有啊  回復  更多評論
              
            久久精品无码一区二区app| 91久久香蕉国产熟女线看| 亚洲狠狠婷婷综合久久蜜芽| 久久夜色精品国产噜噜噜亚洲AV | 日韩精品无码久久一区二区三| 亚洲精品成人网久久久久久| 99久久免费国产特黄| 热RE99久久精品国产66热| 四虎国产精品免费久久久| 狠狠综合久久AV一区二区三区| 亚洲伊人久久大香线蕉苏妲己| 亚洲午夜久久久影院| 日韩久久久久中文字幕人妻| 久久天堂电影网| 久久久久久久久无码精品亚洲日韩 | 国产成人香蕉久久久久| 久久久久亚洲AV无码永不| 久久中文精品无码中文字幕| 久久se精品一区二区| 一本久久a久久精品vr综合| 欧美无乱码久久久免费午夜一区二区三区中文字幕 | 精品久久久久久无码专区| 国产香蕉久久精品综合网| 精品久久久久久国产三级| 国产精品一区二区久久精品无码| 久久国产高潮流白浆免费观看| 一级做a爰片久久毛片看看| 久久久久亚洲爆乳少妇无 | 久久精品一区二区三区不卡| 色88久久久久高潮综合影院| 一本一本久久aa综合精品| 色妞色综合久久夜夜| 久久久久久国产a免费观看黄色大片 | 影音先锋女人AV鲁色资源网久久| 亚洲午夜无码久久久久小说| 无码任你躁久久久久久| 亚洲人成网站999久久久综合| 国产精品久久久久免费a∨| 国产欧美久久久精品影院| 久久久久亚洲AV无码网站| 久久福利青草精品资源站免费|