mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Merge pull request #105326 from basicer/fix-unused-paramater-warning
Supress unused paramater warning conflicting with if constexpr
This commit is contained in:
commit
034e614f10
1 changed files with 2 additions and 0 deletions
|
|
@ -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) {
|
_FORCE_INLINE_ void memnew_arr_placement(T *p_start, size_t p_num) {
|
||||||
if constexpr (std::is_trivially_constructible_v<T> && !p_ensure_zero) {
|
if constexpr (std::is_trivially_constructible_v<T> && !p_ensure_zero) {
|
||||||
// Don't need to do anything :)
|
// Don't need to do anything :)
|
||||||
|
(void)p_start;
|
||||||
|
(void)p_num;
|
||||||
} else if constexpr (is_zero_constructible_v<T>) {
|
} else if constexpr (is_zero_constructible_v<T>) {
|
||||||
// Can optimize with memset.
|
// Can optimize with memset.
|
||||||
memset(static_cast<void *>(p_start), 0, p_num * sizeof(T));
|
memset(static_cast<void *>(p_start), 0, p_num * sizeof(T));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue