Convert vk_bitflags_wrapped!
methods to const fn
(#549)
This commit is contained in:
parent
03068a8734
commit
98192d11f2
|
@ -20,17 +20,17 @@ macro_rules! vk_bitflags_wrapped {
|
|||
self.0
|
||||
}
|
||||
#[inline]
|
||||
pub fn is_empty(self) -> bool {
|
||||
self == Self::empty()
|
||||
pub const fn is_empty(self) -> bool {
|
||||
self.0 == Self::empty().0
|
||||
}
|
||||
#[inline]
|
||||
pub fn intersects(self, other: Self) -> bool {
|
||||
self & other != Self::empty()
|
||||
pub const fn intersects(self, other: Self) -> bool {
|
||||
!Self(self.0 & other.0).is_empty()
|
||||
}
|
||||
#[doc = r" Returns whether `other` is a subset of `self`"]
|
||||
#[inline]
|
||||
pub fn contains(self, other: Self) -> bool {
|
||||
self & other == other
|
||||
pub const fn contains(self, other: Self) -> bool {
|
||||
self.0 & other.0 == other.0
|
||||
}
|
||||
}
|
||||
impl ::std::ops::BitOr for $name {
|
||||
|
|
Loading…
Reference in a new issue