Skip to content

Commit

Permalink
migrate away from aligned_storage
Browse files Browse the repository at this point in the history
  • Loading branch information
arvidn committed Jan 14, 2024
1 parent 8b71ce6 commit 4ddeeb6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion include/libtorrent/aux_/aligned_storage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <std::size_t Len, std::size_t Align = alignof(void*)>
struct aligned_storage
{
Expand Down
3 changes: 2 additions & 1 deletion include/libtorrent/aux_/aligned_union.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand All @@ -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 <std::size_t Len, typename... Types>
struct aligned_union
{
Expand Down

0 comments on commit 4ddeeb6

Please sign in to comment.