• <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
            <2009年5月>
            262728293012
            3456789
            10111213141516
            17181920212223
            24252627282930
            31123456

            常用鏈接

            留言簿(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 閱讀(2010) 評論(1)  編輯 收藏 引用

            FeedBack:
            # re: VC8 的 hash_map 2007-04-05 08:59 
            VC7里面一樣有啊  回復  更多評論
              
            婷婷五月深深久久精品| 久久综合综合久久97色| 久久精品免费一区二区| 亚洲午夜久久久久久久久电影网 | 亚洲中文字幕伊人久久无码| 日本久久中文字幕| 国产产无码乱码精品久久鸭| 精品久久久无码中文字幕天天| 亚洲综合伊人久久大杳蕉| 国产高潮国产高潮久久久91| 亚洲级αV无码毛片久久精品| 狠狠干狠狠久久| 伊人久久大香线蕉av不变影院| 久久亚洲精品视频| 色偷偷88888欧美精品久久久| 久久国产香蕉一区精品| 久久精品国产亚洲77777| 欧美伊人久久大香线蕉综合69| 久久国产精品成人片免费| 中文字幕无码av激情不卡久久| 国产精品九九久久免费视频| 久久久无码精品亚洲日韩按摩| 免费精品久久天干天干| 久久久久久久亚洲精品| 国产精品久久久久影院嫩草| 人妻丰满AV无码久久不卡| 久久这里只有精品首页| 午夜精品久久久久久久无码| 国产午夜福利精品久久| 亚洲狠狠久久综合一区77777| 亚洲狠狠婷婷综合久久蜜芽 | 国产69精品久久久久APP下载| 国产精品免费久久| 久久影院久久香蕉国产线看观看| 91亚洲国产成人久久精品| 欧美亚洲国产精品久久蜜芽| 99久久精品国内| 激情五月综合综合久久69| 久久久久人妻一区精品| 亚洲国产精品嫩草影院久久| 久久天天躁狠狠躁夜夜2020|