diff --git a/README.md b/README.md index 18bf780c..0de75b94 100644 --- a/README.md +++ b/README.md @@ -1105,7 +1105,7 @@ It can be observed that there is only one copy of the scoped or unscoped enum va | [gcc](https://gcc.gnu.org/projects/cxx-status.html) | `11`, `12`, `13`| `std::format` not complete in `11`, `12` | `<= 10` | | [clang](https://clang.llvm.org/cxx_status.html) | `15`, `16`| Catch2 needs `cxx_std_20` in `15` | `<= 14` | | [msvc](https://learn.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance) | `16`, `17` | Visual Studio 2019,2022, latest `17.9.5`| `<= 16.9`| -| [xcode](https://developer.apple.com/support/xcode/) | `15` | Some clang issues| `<= 14`| +| [xcode](https://developer.apple.com/support/xcode/) | `15` | Some issues with `constexpr`, workarounds| `<= 14`| [^1]:© 2024 Fix8 Market Technologies Pty Ltd, David L. Dight. [^2]:© 2019 - 2024 Daniil Goncharov diff --git a/include/fix8/conjure_enum.hpp b/include/fix8/conjure_enum.hpp index 7bad2216..531a6106 100644 --- a/include/fix8/conjure_enum.hpp +++ b/include/fix8/conjure_enum.hpp @@ -182,7 +182,7 @@ class conjure_enum final #if defined(__clang__) && defined(__apple_build_version__) // std::count_if not constexpr in xcode/clang template - static constexpr auto count_if_constexpr(const std::array& valid) noexcept + static constexpr auto count_if_constexpr(const bool (&valid)[N]) noexcept { std::size_t cnt{}; for(std::size_t nn{}; nn < N; ++nn) @@ -195,10 +195,11 @@ class conjure_enum final template static constexpr auto _values(std::index_sequence) noexcept { - constexpr std::array valid { is_valid(enum_min_value + I)>()... }; #if defined(__clang__) && defined(__apple_build_version__) + constexpr bool valid[sizeof...(I)] { is_valid(enum_min_value + I)>()... }; constexpr auto num_valid { count_if_constexpr(valid) }; #else + constexpr std::array valid { is_valid(enum_min_value + I)>()... }; constexpr auto num_valid { std::count_if(valid.cbegin(), valid.cend(), [](bool val) noexcept { return val; }) }; #endif static_assert(num_valid > 0, "conjure_enum requires non-empty enum");