From a23e24ffee8327f28d5560b69bde75080334d606 Mon Sep 17 00:00:00 2001 From: Ed Catmur Date: Mon, 15 May 2023 02:03:10 +0100 Subject: [PATCH] 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 --- include/boost/beast/core/detail/type_traits.hpp | 3 ++- include/boost/beast/websocket/detail/decorator.hpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/boost/beast/core/detail/type_traits.hpp b/include/boost/beast/core/detail/type_traits.hpp index 8e028004..6f44ee55 100644 --- a/include/boost/beast/core/detail/type_traits.hpp +++ b/include/boost/beast/core/detail/type_traits.hpp @@ -10,6 +10,7 @@ #ifndef BOOST_BEAST_DETAIL_TYPE_TRAITS_HPP #define BOOST_BEAST_DETAIL_TYPE_TRAITS_HPP +#include #include #include #include @@ -64,7 +65,7 @@ struct aligned_union std::size_t constexpr alignment_value = max_alignof(); - using type = typename std::aligned_storage< + using type = typename boost::aligned_storage< (Len > max_sizeof()) ? Len : (max_sizeof()), alignment_value>::type; }; diff --git a/include/boost/beast/websocket/detail/decorator.hpp b/include/boost/beast/websocket/detail/decorator.hpp index 03c1c8f6..976cb777 100644 --- a/include/boost/beast/websocket/detail/decorator.hpp +++ b/include/boost/beast/websocket/detail/decorator.hpp @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -62,7 +63,7 @@ class decorator { void* p_; void (*fn_)(); - typename std::aligned_storage< + typename boost::aligned_storage< sizeof(exemplar), alignof(exemplar)>::type buf_; };