1
0
Fork 0
mirror of https://github.com/Neargye/magic_enum.git synced 2026-01-08 23:24:20 +00:00

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
This commit is contained in:
Thomas Khyn 2025-02-20 21:38:17 +13:00 committed by GitHub
parent ff6e5dd1c8
commit a413fcc9c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -52,10 +52,10 @@ namespace magic_enum::containers {
namespace detail {
template <typename T, typename = void>
static constexpr bool is_transparent_v{};
inline constexpr bool is_transparent_v{};
template <typename T>
static constexpr bool is_transparent_v<T, std::void_t<typename T::is_transparent>>{true};
inline constexpr bool is_transparent_v<T, std::void_t<typename T::is_transparent>>{true};
template <typename Eq = std::equal_to<>, typename T1, typename T2>
constexpr bool equal(T1&& t1, T2&& t2, Eq&& eq = {}) {