Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion websocketpp/common/type_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#ifndef WEBSOCKETPP_COMMON_TYPE_TRAITS_HPP
#define WEBSOCKETPP_COMMON_TYPE_TRAITS_HPP

#include <cstddef>
#include <websocketpp/common/cpp11.hpp>

// If we've determined that we're in full C++11 mode and the user hasn't
Expand All @@ -52,7 +53,18 @@ namespace websocketpp {
namespace lib {

#ifdef _WEBSOCKETPP_CPP11_TYPE_TRAITS_
using std::aligned_storage;
// NOTE: this is may not be the best way to detect c++23 compilers, but it worked fine for all test I did
// std::aligned_storage has been depracated as of c++23 (see P1413R3 for more details)
template<std::size_t N>
struct aligned_storage {
#if __cplusplus >= 202300L
struct type {
alignas(std::max_align_t) unsigned char data[N];
};
#else
using type = typename std::aligned_storage<N>::type;
#endif
};
using std::is_same;
#else
using boost::aligned_storage;
Expand Down