From 9a9308fd5477d2a44f4e491d5a712546d4a2b3e4 Mon Sep 17 00:00:00 2001 From: asolwa <53942085+asolwa@users.noreply.github.com> Date: Fri, 19 Jul 2024 14:51:58 +0200 Subject: [PATCH] fix bitset constructor (#367) --- include/magic_enum/magic_enum_containers.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/magic_enum/magic_enum_containers.hpp b/include/magic_enum/magic_enum_containers.hpp index 83b762452..984b38303 100644 --- a/include/magic_enum/magic_enum_containers.hpp +++ b/include/magic_enum/magic_enum_containers.hpp @@ -621,14 +621,14 @@ class bitset { constexpr explicit bitset(string_view sv, Cmp&& cmp = {}, char_type sep = static_cast('|')) { 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(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(sv, cmp)) { - set(v); + set(*v); } else { MAGIC_ENUM_THROW(std::invalid_argument("magic_enum::containers::bitset::constructor: Unrecognized enum value in string")); }