mirror of
https://github.com/boostorg/container.git
synced 2025-08-03 14:34:27 +02:00
Fixes #199 ("Apply LWG issue 3471")
This commit is contained in:
@@ -1342,6 +1342,7 @@ use [*Boost.Container]? There are several reasons for that:
|
|||||||
|
|
||||||
* The library now compiles without warnings with GCC's -Wcast-align=strict
|
* The library now compiles without warnings with GCC's -Wcast-align=strict
|
||||||
* Fixed bugs/issues:
|
* Fixed bugs/issues:
|
||||||
|
* [@https://github.com/boostorg/container/issues/199 GitHub #199: ['"Apply LWG issue 3471 to memory_resource"]].
|
||||||
* [@https://github.com/boostorg/container/issues/206 GitHub #206: ['"operator-> on static_vector::iterator causes cast alignment warning"]].
|
* [@https://github.com/boostorg/container/issues/206 GitHub #206: ['"operator-> on static_vector::iterator causes cast alignment warning"]].
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
#include <boost/container/detail/workaround.hpp>
|
#include <boost/container/detail/workaround.hpp>
|
||||||
#include <boost/container/container_fwd.hpp>
|
#include <boost/container/container_fwd.hpp>
|
||||||
#include <boost/move/detail/type_traits.hpp>
|
#include <boost/move/detail/type_traits.hpp>
|
||||||
|
#include <boost/container/detail/placement_new.hpp>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
@@ -41,7 +42,11 @@ class memory_resource
|
|||||||
//! <b>Effects</b>: Equivalent to
|
//! <b>Effects</b>: Equivalent to
|
||||||
//! `return do_allocate(bytes, alignment);`
|
//! `return do_allocate(bytes, alignment);`
|
||||||
void* allocate(std::size_t bytes, std::size_t alignment = max_align)
|
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
|
//! <b>Effects</b>: Equivalent to
|
||||||
//! `return do_deallocate(bytes, alignment);`
|
//! `return do_deallocate(bytes, alignment);`
|
||||||
|
Reference in New Issue
Block a user