diff --git a/include/libtorrent/aux_/aligned_storage.hpp b/include/libtorrent/aux_/aligned_storage.hpp index 935317663f4..9f81fa069ac 100644 --- a/include/libtorrent/aux_/aligned_storage.hpp +++ b/include/libtorrent/aux_/aligned_storage.hpp @@ -38,9 +38,10 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { namespace aux { -#if defined __GNUC__ && __GNUC__ < 5 && !defined(_LIBCPP_VERSION) +#if __cplusplus >= 202302L || defined __GNUC__ && __GNUC__ < 5 && !defined(_LIBCPP_VERSION) // this is for backwards compatibility with not-quite C++11 compilers +// and for C++23 which deprecated std::aligned_storage template struct aligned_storage { diff --git a/include/libtorrent/aux_/aligned_union.hpp b/include/libtorrent/aux_/aligned_union.hpp index 012b95580e1..0864b08357b 100644 --- a/include/libtorrent/aux_/aligned_union.hpp +++ b/include/libtorrent/aux_/aligned_union.hpp @@ -38,7 +38,7 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { namespace aux { -#if defined __GNUC__ && __GNUC__ < 5 && !defined(_LIBCPP_VERSION) +#if __cplusplus >= 202302L || defined __GNUC__ && __GNUC__ < 5 && !defined(_LIBCPP_VERSION) constexpr std::size_t max(std::size_t a) { return a; } @@ -51,6 +51,7 @@ constexpr std::size_t max(std::size_t a, std::size_t b, Vals... v) { return max(a, max(b, v...)); } // this is for backwards compatibility with not-quite C++11 compilers +// and for C++23 which deprecated std::aligned_union template struct aligned_union {