Răsfoiți Sursa

Supress unused paramater warning conflicting with if constexpr

Rob Blanckaert 3 luni în urmă
părinte
comite
88a43b7039
1 a modificat fișierele cu 2 adăugiri și 0 ștergeri
  1. 2 0
      core/os/memory.h

+ 2 - 0
core/os/memory.h

@@ -200,6 +200,8 @@ template <bool p_ensure_zero = false, typename T>
 _FORCE_INLINE_ void memnew_arr_placement(T *p_start, size_t p_num) {
 	if constexpr (std::is_trivially_constructible_v<T> && !p_ensure_zero) {
 		// Don't need to do anything :)
+		(void)p_start;
+		(void)p_num;
 	} else if constexpr (is_zero_constructible_v<T>) {
 		// Can optimize with memset.
 		memset(static_cast<void *>(p_start), 0, p_num * sizeof(T));