From a413fcc9c46a020a746907136a384c227f3cd095 Mon Sep 17 00:00:00 2001 From: Thomas Khyn Date: Thu, 20 Feb 2025 21:38:17 +1300 Subject: [PATCH] fix: use `inline` instead of `static` for constexpr in header file (#401) Using `static constexpr` in a header file does not seem to be correct - see [1] - and generates a bug when building the magic_enum module with GCC 15 [1] https://isocpp.org/blog/2018/05/quick-q-use-of-constexpr-in-header-file --- include/magic_enum/magic_enum_containers.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/magic_enum/magic_enum_containers.hpp b/include/magic_enum/magic_enum_containers.hpp index f817306..9a0208a 100644 --- a/include/magic_enum/magic_enum_containers.hpp +++ b/include/magic_enum/magic_enum_containers.hpp @@ -52,10 +52,10 @@ namespace magic_enum::containers { namespace detail { template -static constexpr bool is_transparent_v{}; +inline constexpr bool is_transparent_v{}; template -static constexpr bool is_transparent_v>{true}; +inline constexpr bool is_transparent_v>{true}; template , typename T1, typename T2> constexpr bool equal(T1&& t1, T2&& t2, Eq&& eq = {}) {