mirror of
https://github.com/Neargye/magic_enum.git
synced 2026-01-09 23:34:23 +00:00
Update magic_enum_containers.hpp
Fix bitset constructor.
This commit is contained in:
parent
664ee62c12
commit
fb3c8308a2
1 changed files with 2 additions and 2 deletions
|
|
@ -621,14 +621,14 @@ class bitset {
|
|||
constexpr explicit bitset(string_view sv, Cmp&& cmp = {}, char_type sep = static_cast<char_type>('|')) {
|
||||
for (std::size_t to = 0; (to = magic_enum::detail::find(sv, sep)) != string_view::npos; sv.remove_prefix(to + 1)) {
|
||||
if (auto v = enum_cast<E>(sv.substr(0, to), cmp)) {
|
||||
set(v);
|
||||
set(*v);
|
||||
} else {
|
||||
MAGIC_ENUM_THROW(std::invalid_argument("magic_enum::containers::bitset::constructor: Unrecognized enum value in string"));
|
||||
}
|
||||
}
|
||||
if (!sv.empty()) {
|
||||
if (auto v = enum_cast<E>(sv, cmp)) {
|
||||
set(v);
|
||||
set(*v);
|
||||
} else {
|
||||
MAGIC_ENUM_THROW(std::invalid_argument("magic_enum::containers::bitset::constructor: Unrecognized enum value in string"));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue