The following is a representation of my problem.
#include <boost/lockfree/spsc_queue.hpp>
class test {
struct complicated {
int x;
int y;
};
std::allocator<complicated> alloc;
boost::lockfree::spsc_queue<complicated,
boost::lockfree::allocator<std::allocator<complicated> > > spsc;
test(void);
};
test::test(void): spsc( alloc ) {};
With this code I have the following error with VS2010:
error C2512: 'boost::lockfree::detail::runtime_sized_ringbuffer' : no appropriate default constructor available
while compiling class template member function 'boost::lockfree::spsc_queue::spsc_queue(const std::allocator<_Ty> &)'
The error message states it is compiling a constructor with one argument, which I believe should be the allocator, but the primary error talks about a default constructor.
Starting point of documentation is at http://www.boost.org/doc/libs/1_54_0/doc/html/lockfree.html.
What is the appropriate mechanism for defining boost::lockfree::spsc_queue with boost::lockfree::allocator?