[ox/std] Add another redundant check to suppress GCC's pedantry

This commit is contained in:
Gary Talent 2022-05-28 18:58:33 -05:00
parent bfb441594f
commit 440d9c0a46

View File

@ -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<T*>(m_data);
const auto srcItems = reinterpret_cast<T*>(src.m_data);
for (auto i = 0u; i < count; ++i) {
new (&dstItems[i]) T(std::move(srcItems[i]));
std::construct_at<T>(&dstItems[i], std::move(srcItems[i]));
}
*items = reinterpret_cast<T*>(m_data);
}