1
0
Fork 0
mirror of https://github.com/Neargye/magic_enum.git synced 2026-01-09 23:34:23 +00:00
This commit is contained in:
neargye 2020-08-15 22:52:03 +05:00
parent d525acae66
commit e2578822ed

View file

@ -918,7 +918,7 @@ template <typename E, bool Strict = false>
using D = std::decay_t<E>;
using U = underlying_type_t<D>;
if constexpr(Strict) {
if constexpr (Strict) {
for (std::size_t i = 0; i < detail::count_v<D, true>; ++i) {
if (value == static_cast<U>(enum_value<D>(i))) {
return static_cast<D>(value);
@ -1047,7 +1047,9 @@ template <typename E, bool Strict = false>
return enum_cast<D, Strict>(value).has_value();
}
namespace ostream_operators {
} // namespace magic_enum::flags
namespace flags::ostream_operators {
template <typename Char, typename Traits, typename E, detail::enable_if_enum_flags_t<E, int> = 0>
std::basic_ostream<Char, Traits>& operator<<(std::basic_ostream<Char, Traits>& os, E value) {
@ -1076,14 +1078,12 @@ std::basic_ostream<Char, Traits>& operator<<(std::basic_ostream<Char, Traits>& o
} // namespace magic_enum::flags::ostream_operators
namespace bitwise_operators {
namespace flags::bitwise_operators {
using namespace magic_enum::bitwise_operators;
} // namespace magic_enum::flags::bitwise_operators
} // namespace magic_enum::flags
} // namespace magic_enum
#if defined(__clang__)