Opened 8 years ago

#10716 new Bugs

Pool allocators fail to compile under g++4.7, 4.8 and 4.9

Reported by: Conrad Mercer <conrad.mercer@…> Owned by: Chris Newbold
Milestone: To Be Determined Component: pool
Version: Boost 1.56.0 Severity: Problem
Keywords: allocate_shared allocator compile_error Cc:

Description

Hi,

Usage of either boost::pool_allocator or boost::fast_pool_allocator with std::allocate_shared can cause compile errors on the g++4.7, 4.8, 4.9. There is much more detailed information on the stack overflow question I made: http://stackoverflow.com/questions/26396293/boost-pool-allocators-wont-compile-with-stdallocate-shared-in-g

Code exhibiting the error:

#include "boost/pool/pool.hpp"
#include "boost/pool/pool_alloc.hpp"

#include <memory>

int main(int argc, char** argv)
{
  auto fails = std::allocate_shared<int>( boost::fast_pool_allocator<int>() );

  auto works = std::allocate_shared<int>(boost::fast_pool_allocator<int>(), 5);
}

Simply put boost allocators are still specified using the c++98 style and this causes g++ to fail for the versions of g++ mentioned above. However it should be noted that g++ 5.0 does compile correctly and this implies that updating is not necessarily mandatory. I have made this ticket so that the appropriate people can make a determination about whether to fix this or not. Also note that changing to the c++11 allocator style seems to be straightforward.

Change History (0)

Note: See TracTickets for help on using tickets.