Skip to content

Commit fb3c830

Browse files
authored
Update magic_enum_containers.hpp
Fix bitset constructor.
1 parent 664ee62 commit fb3c830

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/magic_enum/magic_enum_containers.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -621,14 +621,14 @@ class bitset {
621621
constexpr explicit bitset(string_view sv, Cmp&& cmp = {}, char_type sep = static_cast<char_type>('|')) {
622622
for (std::size_t to = 0; (to = magic_enum::detail::find(sv, sep)) != string_view::npos; sv.remove_prefix(to + 1)) {
623623
if (auto v = enum_cast<E>(sv.substr(0, to), cmp)) {
624-
set(v);
624+
set(*v);
625625
} else {
626626
MAGIC_ENUM_THROW(std::invalid_argument("magic_enum::containers::bitset::constructor: Unrecognized enum value in string"));
627627
}
628628
}
629629
if (!sv.empty()) {
630630
if (auto v = enum_cast<E>(sv, cmp)) {
631-
set(v);
631+
set(*v);
632632
} else {
633633
MAGIC_ENUM_THROW(std::invalid_argument("magic_enum::containers::bitset::constructor: Unrecognized enum value in string"));
634634
}

0 commit comments

Comments
 (0)