mirror of
https://github.com/boostorg/container.git
synced 2026-01-19 04:02:17 +00:00
Insert alignment assertion for construct
This commit is contained in:
@@ -47,6 +47,8 @@
|
||||
#include <boost/move/detail/fwd_macros.hpp>
|
||||
#endif
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
||||
|
||||
#if defined(BOOST_CONTAINER_GCC_COMPATIBLE_HAS_DIAGNOSTIC_IGNORED)
|
||||
@@ -488,6 +490,7 @@ struct allocator_traits
|
||||
template <class T, class ...Args>
|
||||
inline static void construct(Allocator & a, T* p, BOOST_FWD_REF(Args)... args)
|
||||
{
|
||||
BOOST_ASSERT(std::size_t(p) % dtl::alignment_of<T>::value == 0);
|
||||
BOOST_STATIC_CONSTEXPR bool value = ::boost::move_detail::and_
|
||||
< dtl::is_not_std_allocator<Allocator>
|
||||
, boost::container::dtl::has_member_function_callable_with_construct
|
||||
|
||||
Reference in New Issue
Block a user