use crate::bitman::ClearBit;
pub trait ClearBitsScattered {
type Type;
fn clear_bits_scattered(self, indices: &[Self::Type]) -> Self::Type;
}
macro_rules! ImplementClearBitsScattered {
($type:ty) => {
impl ClearBitsScattered for $type {
type Type = Self;
#[inline]
fn clear_bits_scattered(self, indices: &[Self::Type]) -> Self::Type {
let mut result = self;
for index in indices {
result = result.clear_bit(*index);
}
result
}
}
};
}
ImplementClearBitsScattered!(u8);
ImplementClearBitsScattered!(u32);
ImplementClearBitsScattered!(u64);