From e719d6d312dc385d5e45ac7205225d39342ee407 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 21 Jan 2024 17:42:21 +0100 Subject: [PATCH] Don't use c++17 if constexpr for now. --- sfw/core/tight_local_vector.h | 6 +++--- sfwl/core/tight_local_vector.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sfw/core/tight_local_vector.h b/sfw/core/tight_local_vector.h index f21a97d..404f0c5 100644 --- a/sfw/core/tight_local_vector.h +++ b/sfw/core/tight_local_vector.h @@ -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(); } } diff --git a/sfwl/core/tight_local_vector.h b/sfwl/core/tight_local_vector.h index f21a97d..404f0c5 100644 --- a/sfwl/core/tight_local_vector.h +++ b/sfwl/core/tight_local_vector.h @@ -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(); } }