diff --git a/src/flags19.lib/flags19/FlagsOf.h b/src/flags19.lib/flags19/FlagsOf.h index 0079886..8dbc40a 100644 --- a/src/flags19.lib/flags19/FlagsOf.h +++ b/src/flags19.lib/flags19/FlagsOf.h @@ -86,8 +86,12 @@ template struct FlagsOf { m_value ^= ((1U << static_cast(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(m_value | other.m_value)}; + } + constexpr auto operator&(FlagsOf const& other) const -> FlagsOf { + return FlagsOf{static_cast(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; }