CharMap

CharMap is an helper struct that allows to test if a char is within a set of characters.

Members

Functions

opBinaryRight
bool opBinaryRight(C c)

Returns true if a character is within the map.

Static functions

opIndex
CharMap opIndex(A a)

Used in the construction process.

opSlice
CharRange opSlice(dchar lo, dchar hi)

Used in the construction process.

Examples

1 CharMap cm = CharMap['a'..'f', '0'..'9' , 'A'..'F', '_', 9];
2 assert('a' in cm);
3 assert('b' in cm);
4 assert('c' in cm);
5 assert('d' in cm);
6 assert('e' in cm);
7 assert('f' in cm);
8 assert('g' !in cm);
9 assert('A' in cm);
10 assert('B' in cm);
11 assert('C' in cm);
12 assert('D' in cm);
13 assert('E' in cm);
14 assert('F' in cm);
15 assert('G' !in cm);
16 assert('0' in cm);
17 assert('4' in cm);
18 assert('9' in cm);
19 assert('_' in cm);
20 assert('%' !in cm);
21 assert('\t' in cm);

Meta