Opened 8 years ago

Last modified 6 years ago

#10897 new Feature Requests

Pool allocator does not perfect forward its arguments

Reported by: bertello.matteo@… Owned by: Chris Newbold
Milestone: To Be Determined Component: pool
Version: Boost 1.58.0 Severity: Problem
Keywords: Cc:

Description

The pool_allocator library has not been updated to C++11 yet. One of the greatest missing feature is the lack of perfect forwarding of the parameters of "conctruct" in pool_allocator and fast_pool_allocator. This prevent the move constructor of the allocated object to be called. Right now the construct implementation is as follow:

static void construct(const pointer ptr, const value_type & t)
{ new (ptr) T(t); }

while it should be:

template<typename ...Args>
static void construct(const pointer ptr, Args&& ...args)
{ new (ptr) T(std::forward<Args> (args)...); }

Change History (2)

comment:2 by malcolm.parsons@…, 6 years ago

Summary: Pool allocator does not perfect forward it's argumentPool allocator does not perfect forward its arguments
Note: See TracTickets for help on using tickets.