Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate awy from aligned_storage #7584

Merged
merged 1 commit into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
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
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
Loading