From 440d9c0a460d68b61ecf83ce7720a9857e9e5085 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 28 May 2022 18:58:33 -0500 Subject: [PATCH] [ox/std] Add another redundant check to suppress GCC's pedantry --- deps/ox/src/ox/std/vector.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deps/ox/src/ox/std/vector.hpp b/deps/ox/src/ox/std/vector.hpp index b55e5858..9ee34066 100644 --- a/deps/ox/src/ox/std/vector.hpp +++ b/deps/ox/src/ox/std/vector.hpp @@ -42,11 +42,13 @@ struct VectorAllocator { } constexpr void moveConstructItemsFrom(T **items, VectorAllocator &src, const std::size_t count, const std::size_t cap) noexcept { - if (cap <= Size) { + // this totally idiotic redundant check (&& count <= Size) is required to address a bug in devkitARM, + // try removing it later + if (cap <= Size && count <= Size) { const auto dstItems = reinterpret_cast(m_data); const auto srcItems = reinterpret_cast(src.m_data); for (auto i = 0u; i < count; ++i) { - new (&dstItems[i]) T(std::move(srcItems[i])); + std::construct_at(&dstItems[i], std::move(srcItems[i])); } *items = reinterpret_cast(m_data); }