@@ -17,13 +17,21 @@ use std::ops::{Deref, DerefMut, Range};
17
17
use bitslice:: { BitSlice , Word } ;
18
18
use bitslice:: { bitwise, Union , Subtract } ;
19
19
20
+ /// Represents some newtyped `usize` wrapper.
21
+ ///
22
+ /// (purpose: avoid mixing indexes for different bitvector domains.)
20
23
pub trait Idx : ' static {
21
24
fn new ( usize ) -> Self ;
22
25
fn idx ( & self ) -> usize ;
23
26
}
24
27
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.
25
33
pub struct OwnIdxSet < T : Idx > {
26
- _pd : PhantomData < fn ( & [ T ] , usize ) -> & T > ,
34
+ _pd : PhantomData < fn ( & T ) > ,
27
35
bits : Vec < Word > ,
28
36
}
29
37
@@ -40,8 +48,13 @@ impl<T: Idx> Clone for OwnIdxSet<T> {
40
48
// requires a transmute relying on representation guarantees that may
41
49
// not hold in the future.
42
50
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.
43
56
pub struct IdxSet < T : Idx > {
44
- _pd : PhantomData < fn ( & [ T ] , usize ) -> & T > ,
57
+ _pd : PhantomData < fn ( & T ) > ,
45
58
bits : [ Word ] ,
46
59
}
47
60
0 commit comments