Fixes #199 ("Apply LWG issue 3471")

This commit is contained in:
Ion Gaztañaga
2022-01-06 23:33:54 +01:00
parent 19e68ee050
commit cf3d6d3c51
2 changed files with 7 additions and 1 deletions
@@ -19,6 +19,7 @@
#include <boost/container/detail/workaround.hpp>
#include <boost/container/container_fwd.hpp>
#include <boost/move/detail/type_traits.hpp>
#include <boost/container/detail/placement_new.hpp>
#include <cstddef>
namespace boost {
@@ -41,7 +42,11 @@ class memory_resource
//! <b>Effects</b>: Equivalent to
//! `return do_allocate(bytes, alignment);`
void* allocate(std::size_t bytes, std::size_t alignment = max_align)
{ return this->do_allocate(bytes, alignment); }
{
//Obtain a pointer to enough storage and initialize the lifetime
//of an array object of the given size in the address
return ::operator new(bytes, this->do_allocate(bytes, alignment), boost_container_new_t());
}
//! <b>Effects</b>: Equivalent to
//! `return do_deallocate(bytes, alignment);`