I am trying to use boost :: singleton_pool to create a large number of Order objects in a high-performance critical multi-threaded expression. Looking at the documentation, this is what I have to do,
struct OrderTag{};
typedef boost::singleton_pool<OrderTag, sizeof(Order)> OrderPool;
boost :: singleton_pool has a malloc static member function that returns a pointer to void *, but I need to create objects of type Order in OrderPool by calling its constructor. Should I use boost :: pool_allocator along with singleton_pool for this?
Thank.
source
share