@@ -17,13 +17,21 @@ use std::ops::{Deref, DerefMut, Range};
1717use bitslice:: { BitSlice , Word } ;
1818use bitslice:: { bitwise, Union , Subtract } ;
1919
20+ /// Represents some newtyped `usize` wrapper.
21+ ///
22+ /// (purpose: avoid mixing indexes for different bitvector domains.)
2023pub trait Idx : ' static {
2124 fn new ( usize ) -> Self ;
2225 fn idx ( & self ) -> usize ;
2326}
2427
28+ /// Represents a set (or packed family of sets), of some element type
29+ /// E, where each E is identified by some unique index type `T`.
30+ ///
31+ /// In other words, `T` is the type used to index into the bitvector
32+ /// this type uses to represent the set of object it holds.
2533pub struct OwnIdxSet < T : Idx > {
26- _pd : PhantomData < fn ( & [ T ] , usize ) -> & T > ,
34+ _pd : PhantomData < fn ( & T ) > ,
2735 bits : Vec < Word > ,
2836}
2937
@@ -40,8 +48,13 @@ impl<T: Idx> Clone for OwnIdxSet<T> {
4048// requires a transmute relying on representation guarantees that may
4149// not hold in the future.
4250
51+ /// Represents a set (or packed family of sets), of some element type
52+ /// E, where each E is identified by some unique index type `T`.
53+ ///
54+ /// In other words, `T` is the type used to index into the bitslice
55+ /// this type uses to represent the set of object it holds.
4356pub struct IdxSet < T : Idx > {
44- _pd : PhantomData < fn ( & [ T ] , usize ) -> & T > ,
57+ _pd : PhantomData < fn ( & T ) > ,
4558 bits : [ Word ] ,
4659}
4760
0 commit comments