• <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里面一樣有啊  回復  更多評論
              
            久久综合88熟人妻| 久久久久久亚洲精品不卡| 久久久久亚洲AV成人片| a级成人毛片久久| 久久天天躁狠狠躁夜夜av浪潮 | 久久99精品久久久久久9蜜桃 | 少妇人妻88久久中文字幕| 国产韩国精品一区二区三区久久| 久久996热精品xxxx| 狠狠综合久久AV一区二区三区| 粉嫩小泬无遮挡久久久久久| 亚洲伊人久久综合中文成人网 | 久久最新免费视频| 久久这里只有精品首页| AV无码久久久久不卡蜜桃| 久久精品99无色码中文字幕| 久久国产精品77777| 99久久这里只精品国产免费| AA级片免费看视频久久| 中文国产成人精品久久不卡| 精品久久久久久无码中文字幕| 精品国产一区二区三区久久久狼| 区亚洲欧美一级久久精品亚洲精品成人网久久久久 | 久久久久波多野结衣高潮| 国产一区二区精品久久凹凸| 国内精品久久久久久野外| 久久久免费精品re6| 精品综合久久久久久98| 漂亮人妻被中出中文字幕久久| 久久嫩草影院免费看夜色| 国产免费福利体检区久久| 日本精品久久久久中文字幕8| 99久久99久久精品免费看蜜桃 | 久久久久久一区国产精品| 久久精品亚洲精品国产欧美| 韩国三级中文字幕hd久久精品| 91精品国产色综久久| 久久精品国产清自在天天线| 久久国产视屏| 久久AV无码精品人妻糸列| 日韩精品久久无码中文字幕|