mirror of
https://github.com/Relintai/sfw.git
synced 2024-11-08 07:52:09 +01:00
Don't use c++17 if constexpr for now.
This commit is contained in:
parent
bdbd1ed4e5
commit
e719d6d312
@ -44,7 +44,7 @@ public:
|
||||
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));
|
||||
} else {
|
||||
data[count++] = p_elem;
|
||||
@ -57,7 +57,7 @@ public:
|
||||
for (U i = p_index; i < count; i++) {
|
||||
data[i] = data[i + 1];
|
||||
}
|
||||
if constexpr (!HAS_TRIVIAL_DESTRUCTOR(T) && !force_trivial) {
|
||||
if (!HAS_TRIVIAL_DESTRUCTOR(T) && !force_trivial) {
|
||||
data[count].~T();
|
||||
}
|
||||
}
|
||||
@ -70,7 +70,7 @@ public:
|
||||
if (count > p_index) {
|
||||
data[p_index] = data[count];
|
||||
}
|
||||
if constexpr (!HAS_TRIVIAL_DESTRUCTOR(T) && !force_trivial) {
|
||||
if (!HAS_TRIVIAL_DESTRUCTOR(T) && !force_trivial) {
|
||||
data[count].~T();
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
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));
|
||||
} else {
|
||||
data[count++] = p_elem;
|
||||
@ -57,7 +57,7 @@ public:
|
||||
for (U i = p_index; i < count; i++) {
|
||||
data[i] = data[i + 1];
|
||||
}
|
||||
if constexpr (!HAS_TRIVIAL_DESTRUCTOR(T) && !force_trivial) {
|
||||
if (!HAS_TRIVIAL_DESTRUCTOR(T) && !force_trivial) {
|
||||
data[count].~T();
|
||||
}
|
||||
}
|
||||
@ -70,7 +70,7 @@ public:
|
||||
if (count > p_index) {
|
||||
data[p_index] = data[count];
|
||||
}
|
||||
if constexpr (!HAS_TRIVIAL_DESTRUCTOR(T) && !force_trivial) {
|
||||
if (!HAS_TRIVIAL_DESTRUCTOR(T) && !force_trivial) {
|
||||
data[count].~T();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user