Boost.Intrusive and fast_pool_allocator

时间:2015-05-04 19:41:03

标签: c++11 boost intrusive-containers

If I say this, I get a strange compiler (gcc4.9, boost 1_58) error later on:

When i go to access this 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;

What is the correct way to do this?

1 个答案:

答案 0 :(得分:1)

这是因为分配器不是您可以传递的“选项”。

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