id summary reporter owner description type status milestone component version severity resolution keywords cc 9328 Error initializing a boost:container's allocator with a reference. jbell@… Ion Gaztañaga "Consider the following: struct arena; struct A : std::allocator { A(arena {} A(arena*) {} }; typedef boost::container::vector > avector; void foo(arena a) { avector v1(a); // error: can't bind a mutable & to a const& avector v2(&a); // fine avector v3(A(a)); // fine avector v3(A(&a)); // fine } The initialization of v1 generates the following compilation error (under GCC 4.4.7): /opt/scidb/13.9/3rdparty/boost/include/boost/container/scoped_allocator.hpp: In constructor ‘boost::container::container_detail::scoped_allocator_adaptor_base::scoped_allocator_adaptor_base(const OuterA2&) [with OuterA2 = ARENA, OuterAlloc = A]’: /opt/scidb/13.9/3rdparty/boost/include/boost/preprocessor/iteration/detail/local.hpp:34: instantiated from ‘boost::container::scoped_allocator_adaptor::scoped_allocator_adaptor(const OuterA2&) [with OuterA2 = ARENA, OuterAlloc = A, Q0 = boost::container::container_detail::nat, Q1 = boost::container::container_detail::nat, Q2 = boost::container::container_detail::nat, Q3 = boost::container::container_detail::nat, Q4 = boost::container::container_detail::nat, Q5 = boost::container::container_detail::nat, Q6 = boost::container::container_detail::nat, Q7 = boost::container::container_detail::nat, Q8 = boost::container::container_detail::nat, Q9 = boost::container::container_detail::nat]’ /local/mem/src/tests/unit/ArenaUnitTests.h:743: instantiated from here /opt/scidb/13.9/3rdparty/boost/include/boost/container/scoped_allocator.hpp:890: error: no matching function for call to ‘A::A(const ARENA&)’ /local/mem/src/tests/unit/ArenaUnitTests.h:736: note: candidates are: A::A(ARENA*) /local/mem/src/tests/unit/ArenaUnitTests.h:735: note: A::A(ARENA&) /local/mem/src/tests/unit/ArenaUnitTests.h:734: note: A::A(const A&) Notice that the implementation of scoped_allocator_adaptor is attempting to initialize the adaptor with a *const* reference to an ARENA when a mutable reference was in fact supplied to the container's constructor. " Bugs closed To Be Determined container Boost 1.54.0 Problem wontfix container scoped_allocator_adaptor