Boost.Intrusive and fast_pool_allocator



如果我这样说,我会得到一个奇怪的编译器(gcc4.9,boost 1_58)错误以后在:

当我去访问此IL时:

for(auto & odp : odpList[i]) //<-error here
{
/usr/local/include/boost/intrusive/pack_options.hpp|33|error: no class template named ‘pack’ in ‘class boost::fast_pool_allocator<OneDepthPrice>’
typedef std::tuple<int, int> OneDepthPrice
typedef boost::intrusive::list<OneDepthPrice,  boost::fast_pool_allocator<OneDepthPrice>, constant_time_size<false>> BaseList;

做到这一点的正确方法是什么?

这是因为分配器不是您可以通过的"选项"。

尝试将分配器传递给侵入式容器是没有意义的,因为您将是管理容器之外分配的人。

最新更新