use std::fmt::Debug;
macro_rules! inplace {
    ($(($name:ident, $action:literal),)*) => {$(
        /// Perform
        #[doc=$action]
        /// between `self` and `rhs` elementwise, updating self.
        ///
        /// # Panics
        /// Might panic if self.len() \neq rhs.len(). In general, if it does not panic, it
                        fn $name(&mut self, rhs: &Self);
    )*}
}
pub trait BooleanVector:
    Debug + Clone + Default + FromIterator<bool> + IntoIterator<Item = bool>
{
            type IterVals<'l>: Iterator<Item = bool>
    where
        Self: 'l;
        fn new() -> Self;
                                        fn zeros(len: usize) -> Self;
                                                            fn set(&mut self, idx: usize, flag: bool);
    inplace!((xor_inplace, "XOR"), (or_inplace, "OR"),);
                                                            fn resize(&mut self, len: usize, flag: bool);
        fn push(&mut self, flag: bool);
            fn pop(&mut self) -> Option<bool>;
        fn len(&self) -> usize;
        fn is_empty(&self) -> bool {
        self.len() == 0
    }
        fn get(&self, idx: usize) -> Option<bool>;
                                                                    fn iter_vals(&self) -> Self::IterVals<'_>;
                                                                        fn sum_up(&self, filter: &[bool]) -> bool {
        self.iter_vals()
            .enumerate()
            .filter_map(|(i, f)| if filter[i] { Some(f) } else { None })
            .fold(false, |acc, next| acc ^ next)
    }
}
mod std_vec;
#[cfg(feature = "bitvec")]
#[cfg_attr(docsrs, doc(cfg(feature = "bitvec")))]
mod bitvec;
#[cfg(feature = "bitvec_simd")]
#[cfg_attr(docsrs, doc(cfg(feature = "bitvec_simd")))]
pub mod bitvec_simd;
#[cfg(feature = "bit-vec")]
#[cfg_attr(docsrs, doc(cfg(feature = "bit-vec")))]
mod bit_vec;
#[cfg(test)]
mod tests {
    use coverage_helper::test;
    use super::*;
    #[test]
    fn is_empty() {
        assert!(<Vec<bool> as BooleanVector>::is_empty(&vec![]));
        assert!(!<Vec<bool> as BooleanVector>::is_empty(&vec![true]));
    }
}