|
|
@@ -96,9 +96,10 @@ template <typename Out> bool cast(Out & out, std::string_view str) noexcept {
|
|
|
return true;
|
|
|
#if __has_include(<magic_enum.hpp>)
|
|
|
} else if constexpr (std::is_enum_v<Out>) {
|
|
|
- std::optional<Out> result = magic_enum::enum_cast<Out>(str);
|
|
|
+ constexpr auto type = magic_enum::as_flags<magic_enum::detail::is_flags_v<Out>>;
|
|
|
+ std::optional<Out> result = magic_enum::enum_cast<Out, type>(str);
|
|
|
out = result.value_or(out);
|
|
|
- return result;
|
|
|
+ return result.has_value();
|
|
|
#endif
|
|
|
} else if constexpr (std::is_integral_v<Out>) {
|
|
|
using V = std::conditional_t<std::is_unsigned_v<Out>, unsigned long, long>;
|