use crate::bitman::IsBitHigh;
pub trait AreBitsLowScattered {
type Type;
fn are_bits_low_scattered(&self, indices: &[Self::Type]) -> bool;
}
macro_rules! ImplementAreBitsLowScattered {
($type:ty) => {
impl AreBitsLowScattered for $type {
type Type = Self;
#[inline]
#[must_use]
fn are_bits_low_scattered(&self, indices: &[Self::Type]) -> bool {
for index in indices {
if self.is_bit_high(*index) {
return false;
}
}
true
}
}
};
}
ImplementAreBitsLowScattered!(u8);
ImplementAreBitsLowScattered!(u32);
ImplementAreBitsLowScattered!(u64);