0

I'm trying to use boost::fast_pool_allocator in place of the standard allocator and it won't work (ironically with another boost library) because fast_pool_allocator has more than one template parameter even though it claims to be compatible with std::allocator and everything except the first has a default value.

I am trying to pass it as a class template that expects a single template parameter. The specific error:

error: type/value mismatch at argument 3 in template parameter list for "template<class Point, template<class, class> class Container, template<class> class Allocator> class boost::geometry::model::multi_point" error: expected a template of type "template<class> class Allocator", got "template<class T, class UserAllocator, class Mutex, unsigned int NextSize, unsigned int MaxSize> class boost::fast_pool_allocator" 

Is there a way to make this actually work?

1
  • Sounds like Boost.Geometry is broken. I'd file a bug. Commented Feb 25, 2014 at 12:49

1 Answer 1

4

Use the following template instead of boost::fast_pool_allocator

template <class T> using fast_pool_allocator_t = boost::fast_pool_allocator<T>; 

This will also work if you are not using C++11.

template <class T> struct fast_pool_allocator_t : boost::fast_pool_allocator<T> { }; 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.