diff --git a/src/ox/std/array.hpp b/src/ox/std/array.hpp index d20a6180a..242010f1a 100644 --- a/src/ox/std/array.hpp +++ b/src/ox/std/array.hpp @@ -137,12 +137,16 @@ constexpr Array::Array(Array &&other) noexcept { template constexpr bool Array::operator==(const Array &other) const { - for (std::size_t i = 0; i < ArraySize; i++) { - if (!(m_items[i] == other.m_items[i])) { - return false; + if (std::is_constant_evaluated()) { + for (std::size_t i = 0; i < ArraySize; i++) { + if (!(m_items[i] == other.m_items[i])) { + return false; + } } + return true; + } else { + return memcmp(this, &other, sizeof(*this)) == 0; } - return true; } template