From 7d1d6304572fd062523000f9765530694a8297fd Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Wed, 21 Aug 2024 10:15:33 -0600 Subject: [PATCH] Reimplement event assertions to loosen constexpr restrictions on event subtypes Co-authored-by: Vittorio Romeo --- include/SFML/Window/Event.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/SFML/Window/Event.hpp b/include/SFML/Window/Event.hpp index 4f2fa9c0a..caaeda74d 100644 --- a/include/SFML/Window/Event.hpp +++ b/include/SFML/Window/Event.hpp @@ -373,13 +373,13 @@ private: // Helper functions //////////////////////////////////////////////////////////// template - [[nodiscard]] static constexpr bool isInParameterPack(const std::variant&) + [[nodiscard]] static constexpr bool isInParameterPack(const std::variant*) { return (std::is_same_v || ...); } template - static constexpr bool isEventSubtype = isInParameterPack(decltype(m_data)()); + static constexpr bool isEventSubtype = isInParameterPack(decltype (&m_data)(nullptr)); }; } // namespace sf