forked from boostorg/beast
Reimplement (C++23) deprecated std::aligned_storage (#2680)
Use boost::aligned_storage instead of std::. The latter is deprecated in C++23. --------- Co-authored-by: Ed Catmur <edward.catmur@mavensecurities.com>
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#ifndef BOOST_BEAST_DETAIL_TYPE_TRAITS_HPP
|
||||
#define BOOST_BEAST_DETAIL_TYPE_TRAITS_HPP
|
||||
|
||||
#include <boost/type_traits/aligned_storage.hpp>
|
||||
#include <boost/type_traits/make_void.hpp>
|
||||
#include <type_traits>
|
||||
#include <new>
|
||||
@@ -64,7 +65,7 @@ struct aligned_union
|
||||
std::size_t constexpr alignment_value =
|
||||
max_alignof<Ts...>();
|
||||
|
||||
using type = typename std::aligned_storage<
|
||||
using type = typename boost::aligned_storage<
|
||||
(Len > max_sizeof<Ts...>()) ? Len : (max_sizeof<Ts...>()),
|
||||
alignment_value>::type;
|
||||
};
|
||||
|
@@ -12,6 +12,7 @@
|
||||
|
||||
#include <boost/beast/websocket/rfc6455.hpp>
|
||||
#include <boost/core/exchange.hpp>
|
||||
#include <boost/type_traits/aligned_storage.hpp>
|
||||
#include <boost/type_traits/make_void.hpp>
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
@@ -62,7 +63,7 @@ class decorator
|
||||
{
|
||||
void* p_;
|
||||
void (*fn_)();
|
||||
typename std::aligned_storage<
|
||||
typename boost::aligned_storage<
|
||||
sizeof(exemplar),
|
||||
alignof(exemplar)>::type buf_;
|
||||
};
|
||||
|
Reference in New Issue
Block a user