From fd8dc03ae9b3dade13cc66f607065724c4fc1b28 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Tue, 16 Jul 2024 11:19:16 +0300 Subject: [PATCH] BAN: Default initialize optional storage This removes maybe uninitialized warning when using default initialized optionals. --- BAN/include/BAN/Optional.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BAN/include/BAN/Optional.h b/BAN/include/BAN/Optional.h index 8f4987dfd8..4d50c20e73 100644 --- a/BAN/include/BAN/Optional.h +++ b/BAN/include/BAN/Optional.h @@ -44,7 +44,7 @@ namespace BAN constexpr void clear(); private: - alignas(T) uint8_t m_storage[sizeof(T)]; + alignas(T) uint8_t m_storage[sizeof(T)] {}; bool m_has_value { false }; };