Boost.Intrusive and fast_pool_allocator

120 Views Asked by At

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

There are 1 best solutions below

0
user541686 On

It's because an allocator is not an "option" that you can pass.

It doesn't make sense to try and pass an allocator to an intrusive container, though, since you would be the one managing the allocations outside of the container.