[ox/std] Fix Vector move to not do small vector opt in consteval
This commit is contained in:
parent
6ddeb29c92
commit
3a2995a67b
4
deps/ox/src/ox/std/vector.hpp
vendored
4
deps/ox/src/ox/std/vector.hpp
vendored
@ -44,7 +44,7 @@ struct VectorAllocator {
|
|||||||
constexpr void moveConstructItemsFrom(T **items, VectorAllocator &src, const std::size_t count, const std::size_t cap) noexcept {
|
constexpr void moveConstructItemsFrom(T **items, VectorAllocator &src, const std::size_t count, const std::size_t cap) noexcept {
|
||||||
// this totally idiotic redundant check (&& count <= Size) is required to address a bug in devkitARM,
|
// this totally idiotic redundant check (&& count <= Size) is required to address a bug in devkitARM,
|
||||||
// try removing it later
|
// try removing it later
|
||||||
if (cap <= Size && count <= Size) {
|
if (!std::is_constant_evaluated() && cap <= Size && count <= Size) {
|
||||||
const auto dstItems = reinterpret_cast<T*>(m_data);
|
const auto dstItems = reinterpret_cast<T*>(m_data);
|
||||||
const auto srcItems = reinterpret_cast<T*>(src.m_data);
|
const auto srcItems = reinterpret_cast<T*>(src.m_data);
|
||||||
for (auto i = 0u; i < count; ++i) {
|
for (auto i = 0u; i < count; ++i) {
|
||||||
@ -57,7 +57,7 @@ struct VectorAllocator {
|
|||||||
constexpr void moveItemsFrom(T **items, VectorAllocator &src, const std::size_t count, const std::size_t cap) noexcept {
|
constexpr void moveItemsFrom(T **items, VectorAllocator &src, const std::size_t count, const std::size_t cap) noexcept {
|
||||||
// this totally idiotic redundant check (&& count <= Size) is required to address a bug in devkitARM,
|
// this totally idiotic redundant check (&& count <= Size) is required to address a bug in devkitARM,
|
||||||
// try removing it later
|
// try removing it later
|
||||||
if (cap <= Size && count <= Size) {
|
if (!std::is_constant_evaluated() && cap <= Size && count <= Size) {
|
||||||
const auto dstItems = reinterpret_cast<T*>(m_data);
|
const auto dstItems = reinterpret_cast<T*>(m_data);
|
||||||
const auto srcItems = reinterpret_cast<T*>(src.m_data);
|
const auto srcItems = reinterpret_cast<T*>(src.m_data);
|
||||||
for (std::size_t i = 0; i < count; ++i) {
|
for (std::size_t i = 0; i < count; ++i) {
|
||||||
|
Loading…
Reference in New Issue
Block a user