range-set-blaze 0.1.16

Integer sets as fast, sorted, integer ranges with full set operations
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use range_set_blaze::prelude::*;

fn main() {
    let a = RangeSetBlaze::from_iter([1..=6, 8..=9, 11..=15]);
    let b = RangeSetBlaze::from_iter([5..=13, 18..=29]);
    let c = RangeSetBlaze::from_iter([38..=42]);

    let parity = union_dyn!(
        intersection_dyn!(a.ranges(), !b.ranges(), !c.ranges()),
        intersection_dyn!(!a.ranges(), b.ranges(), !c.ranges()),
        intersection_dyn!(!a.ranges(), !b.ranges(), c.ranges()),
        intersection_dyn!(a.ranges(), b.ranges(), c.ranges())
    );
    assert_eq!(
        parity.to_string(),
        "1..=4, 7..=7, 10..=10, 14..=15, 18..=29, 38..=42"
    );
}