Don't use c++17 if constexpr for now.

This commit is contained in:
Relintai 2024-01-21 17:42:21 +01:00
parent bdbd1ed4e5
commit e719d6d312
2 changed files with 6 additions and 6 deletions

View File

@ -44,7 +44,7 @@ public:
CRASH_COND_MSG(!data, "Out of memory"); CRASH_COND_MSG(!data, "Out of memory");
} }
if constexpr (!HAS_TRIVIAL_CONSTRUCTOR(T) && !force_trivial) { if (!HAS_TRIVIAL_CONSTRUCTOR(T) && !force_trivial) {
memnew_placement(&data[count++], T(p_elem)); memnew_placement(&data[count++], T(p_elem));
} else { } else {
data[count++] = p_elem; data[count++] = p_elem;
@ -57,7 +57,7 @@ public:
for (U i = p_index; i < count; i++) { for (U i = p_index; i < count; i++) {
data[i] = data[i + 1]; data[i] = data[i + 1];
} }
if constexpr (!HAS_TRIVIAL_DESTRUCTOR(T) && !force_trivial) { if (!HAS_TRIVIAL_DESTRUCTOR(T) && !force_trivial) {
data[count].~T(); data[count].~T();
} }
} }
@ -70,7 +70,7 @@ public:
if (count > p_index) { if (count > p_index) {
data[p_index] = data[count]; data[p_index] = data[count];
} }
if constexpr (!HAS_TRIVIAL_DESTRUCTOR(T) && !force_trivial) { if (!HAS_TRIVIAL_DESTRUCTOR(T) && !force_trivial) {
data[count].~T(); data[count].~T();
} }
} }

View File

@ -44,7 +44,7 @@ public:
CRASH_COND_MSG(!data, "Out of memory"); CRASH_COND_MSG(!data, "Out of memory");
} }
if constexpr (!HAS_TRIVIAL_CONSTRUCTOR(T) && !force_trivial) { if (!HAS_TRIVIAL_CONSTRUCTOR(T) && !force_trivial) {
memnew_placement(&data[count++], T(p_elem)); memnew_placement(&data[count++], T(p_elem));
} else { } else {
data[count++] = p_elem; data[count++] = p_elem;
@ -57,7 +57,7 @@ public:
for (U i = p_index; i < count; i++) { for (U i = p_index; i < count; i++) {
data[i] = data[i + 1]; data[i] = data[i + 1];
} }
if constexpr (!HAS_TRIVIAL_DESTRUCTOR(T) && !force_trivial) { if (!HAS_TRIVIAL_DESTRUCTOR(T) && !force_trivial) {
data[count].~T(); data[count].~T();
} }
} }
@ -70,7 +70,7 @@ public:
if (count > p_index) { if (count > p_index) {
data[p_index] = data[count]; data[p_index] = data[count];
} }
if constexpr (!HAS_TRIVIAL_DESTRUCTOR(T) && !force_trivial) { if (!HAS_TRIVIAL_DESTRUCTOR(T) && !force_trivial) {
data[count].~T(); data[count].~T();
} }
} }