You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Until const traits become usable on stable, it'd be nice to have a macro along the lines of const_bitflag_or, which would expand to use Flags::NAME.bits() and Flags::from_bits_truncate:
const_bitflag_or!(Flags, A, B, C)
would become Flags::from_bits_truncate(Flags::A.bits() | Flags::B.bits() | Flags::C.bits())
The text was updated successfully, but these errors were encountered:
Just coming back through some triage. I think this isn't something we're going to support in bitflags through a macro, but will absolutely jump on const_trait_impl once it stabilizes. Thanks for the input everyone!
Until const traits become usable on stable, it'd be nice to have a macro along the lines of
const_bitflag_or
, which would expand to useFlags::NAME.bits()
andFlags::from_bits_truncate
:const_bitflag_or!(Flags, A, B, C)
would become
Flags::from_bits_truncate(Flags::A.bits() | Flags::B.bits() | Flags::C.bits())
The text was updated successfully, but these errors were encountered: