BitArray.opEquals

Support for operators == and != for BitArray.

struct BitArray
const @nogc pure nothrow
bool
opEquals
(
const ref BitArray a2
)

Examples

1 bool[] ba = [1,0,1,0,1];
2 bool[] bb = [1,0,1];
3 bool[] bc = [1,0,1,0,1,0,1];
4 bool[] bd = [1,0,1,1,1];
5 bool[] be = [1,0,1,0,1];
6 bool[] bf = [1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
7 bool[] bg = [1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1];
8 
9 auto a = BitArray(ba);
10 auto b = BitArray(bb);
11 auto c = BitArray(bc);
12 auto d = BitArray(bd);
13 auto e = BitArray(be);
14 auto f = BitArray(bf);
15 auto g = BitArray(bg);
16 
17 assert(a != b);
18 assert(a != c);
19 assert(a != d);
20 assert(a == e);
21 assert(f != g);

Meta

Suggestion Box / Bug Report