3
我只是试验boost :: pool,看看它是一个更快的分配器,我正在使用的东西,但我不知道如何使用它与boost :: unordered_map:使用boost :: pool_allocator和boost :: unordered_map的语法是什么?
这是一个代码片段:
unordered_map<int,int,boost::hash<int>, fast_pool_allocator<int>> theMap;
theMap[1] = 2;
以下是编译错误,我得到:
错误3错误C2064:术语不计算为以2个为参数的C函数:\程序文件(x86)\提升\ boost_1_38 \ boost \ unordered \ detail \ hash_table_impl.hpp 2048
如果我注释掉地图的使用,例如“theMap [1] = 2”则编译错误消失。
谢谢,就是这样。 – 2009-06-30 03:22:26