Skip to content

Commit

Permalink
Fix(FlagsOf): Required conversion after compute
Browse files Browse the repository at this point in the history
  • Loading branch information
arBmind committed Sep 26, 2024
1 parent 8fcef31 commit 0d40a5f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/flags19.lib/flags19/FlagsOf.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,12 @@ template<HasMetaEnum Enum> struct FlagsOf {
m_value ^= ((1U << static_cast<UnderlyingBit>(args)) | ...);
}

constexpr auto operator|(FlagsOf const& other) const -> FlagsOf { return FlagsOf{m_value | other.m_value}; }
constexpr auto operator&(FlagsOf const& other) const -> FlagsOf { return FlagsOf{m_value & other.m_value}; }
constexpr auto operator|(FlagsOf const& other) const -> FlagsOf {
return FlagsOf{static_cast<Value>(m_value | other.m_value)};
}
constexpr auto operator&(FlagsOf const& other) const -> FlagsOf {
return FlagsOf{static_cast<Value>(m_value & other.m_value)};
}
constexpr auto operator|=(FlagsOf const& other) -> FlagsOf& { return m_value |= other.m_value, *this; }
constexpr auto operator&=(FlagsOf const& other) -> FlagsOf& { return m_value &= other.m_value, *this; }

Expand Down

0 comments on commit 0d40a5f

Please sign in to comment.