Skip to content

Commit 0d40a5f

Browse files
committed
Fix(FlagsOf): Required conversion after compute
1 parent 8fcef31 commit 0d40a5f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/flags19.lib/flags19/FlagsOf.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,12 @@ template<HasMetaEnum Enum> struct FlagsOf {
8686
m_value ^= ((1U << static_cast<UnderlyingBit>(args)) | ...);
8787
}
8888

89-
constexpr auto operator|(FlagsOf const& other) const -> FlagsOf { return FlagsOf{m_value | other.m_value}; }
90-
constexpr auto operator&(FlagsOf const& other) const -> FlagsOf { return FlagsOf{m_value & other.m_value}; }
89+
constexpr auto operator|(FlagsOf const& other) const -> FlagsOf {
90+
return FlagsOf{static_cast<Value>(m_value | other.m_value)};
91+
}
92+
constexpr auto operator&(FlagsOf const& other) const -> FlagsOf {
93+
return FlagsOf{static_cast<Value>(m_value & other.m_value)};
94+
}
9195
constexpr auto operator|=(FlagsOf const& other) -> FlagsOf& { return m_value |= other.m_value, *this; }
9296
constexpr auto operator&=(FlagsOf const& other) -> FlagsOf& { return m_value &= other.m_value, *this; }
9397

0 commit comments

Comments
 (0)