• <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
            <2007年3月>
            25262728123
            45678910
            11121314151617
            18192021222324
            25262728293031
            1234567

            常用鏈接

            留言簿(1)

            隨筆檔案

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            剛剛裝上VC8,發現VC8現在也支持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 閱讀(2015) 評論(1)  編輯 收藏 引用

            FeedBack:
            # re: VC8 的 hash_map 2007-04-05 08:59 
            VC7里面一樣有啊  回復  更多評論
              
            久久电影网一区| 青青草原综合久久大伊人| 91精品国产综合久久婷婷| 欧美精品一本久久男人的天堂| 久久激情亚洲精品无码?V| 77777亚洲午夜久久多人| 色综合合久久天天综合绕视看 | 18岁日韩内射颜射午夜久久成人| 久久这里只有精品18| 久久综合九色综合久99| 99久久99这里只有免费费精品| 久久久久99精品成人片牛牛影视| 国产精品女同久久久久电影院| 久久久久亚洲av毛片大| 久久青草国产手机看片福利盒子| 久久久久se色偷偷亚洲精品av| 国产精品无码久久四虎| AV狠狠色丁香婷婷综合久久| 久久精品中文无码资源站| 久久毛片免费看一区二区三区| 日韩精品国产自在久久现线拍| 麻豆成人久久精品二区三区免费| 一个色综合久久| 久久天天躁狠狠躁夜夜av浪潮| 国产成人香蕉久久久久| 久久精品成人免费网站| 久久精品www人人爽人人| 亚洲国产精品高清久久久| 久久人人爽人人爽人人片AV麻烦 | 久久夜色精品国产噜噜噜亚洲AV| 亚洲伊人久久综合影院| 武侠古典久久婷婷狼人伊人| 久久精品视频91| 欧美伊人久久大香线蕉综合69| 青青青青久久精品国产h久久精品五福影院1421 | 奇米综合四色77777久久| 麻豆AV一区二区三区久久| 亚洲成色WWW久久网站| 国产精品99久久免费观看| 久久99热只有频精品8| 欧美亚洲国产精品久久蜜芽|