• <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里面一樣有啊  回復  更多評論
              
            久久成人精品视频| 久久一区二区免费播放| 麻豆AV一区二区三区久久| 国产亚洲欧美精品久久久| 超级碰久久免费公开视频| 奇米影视7777久久精品人人爽| 国产激情久久久久久熟女老人 | 人妻精品久久无码区| 韩国免费A级毛片久久| 国产精品九九久久免费视频 | 日韩AV毛片精品久久久| 久久乐国产综合亚洲精品| 久久99国产综合精品免费| 久久男人AV资源网站| 国产一久久香蕉国产线看观看| 亚洲国产综合久久天堂| 97久久超碰国产精品旧版| 香蕉99久久国产综合精品宅男自| 久久99精品久久只有精品| 综合久久一区二区三区| 久久久精品免费国产四虎| 国产精品久久久久久久久久影院| 色综合合久久天天综合绕视看| 亚洲日本va中文字幕久久| 欧美色综合久久久久久| a级毛片无码兔费真人久久| 99久久久国产精品免费无卡顿| 狠狠色噜噜色狠狠狠综合久久| 久久精品国产亚洲Aⅴ香蕉| 久久久国产精品福利免费| 99久久99久久| 久久精品一区二区三区不卡| 久久人人爽人人爽人人片av高请| 亚洲精品tv久久久久久久久| 中文字幕精品无码久久久久久3D日动漫| 97精品国产97久久久久久免费| 国产精品美女久久久m| 波多野结衣中文字幕久久 | 精品九九久久国内精品| 久久久久女人精品毛片| 国产精品久久久久影院色|