diff --git a/include/magic_enum.hpp b/include/magic_enum.hpp index 79294c7..d7dfbc7 100644 --- a/include/magic_enum.hpp +++ b/include/magic_enum.hpp @@ -710,8 +710,8 @@ template // Returns std::optional with enum value. template [[nodiscard]] constexpr auto enum_cast(std::string_view value, BinaryPredicate p) noexcept(std::is_nothrow_invocable_r_v) -> detail::enable_if_enum_t>> { - using D = std::decay_t; static_assert(std::is_invocable_r_v, "magic_enum::enum_cast requires bool(char, char) invocable predicate."); + using D = std::decay_t; for (std::size_t i = 0; i < detail::count_v; ++i) { if (detail::cmp_equal(value, detail::names_v[i], p)) { @@ -1063,8 +1063,8 @@ template // Checks whether enum-flags contains enumerator with such string name. template [[nodiscard]] constexpr auto enum_contains(std::string_view value, BinaryPredicate p) noexcept(std::is_nothrow_invocable_r_v) -> detail::enable_if_enum_flags_t { - using D = std::decay_t; static_assert(std::is_invocable_r_v, "magic_enum::flags::enum_contains requires bool(char, char) invocable predicate."); + using D = std::decay_t; return enum_cast(value, std::move_if_noexcept(p)).has_value(); } @@ -1108,12 +1108,6 @@ std::basic_ostream& operator<<(std::basic_ostream& o } // namespace magic_enum::flags::ostream_operators -namespace flags::bitwise_operators { - -using namespace magic_enum::bitwise_operators; - -} // namespace magic_enum::flags::bitwise_operators - } // namespace magic_enum #if defined(__clang__)