To tell if a bit is set in array, it selects an element from the array, and test * if the relevant bit set. * Note the parameter "bit" is an index to the bit, 0 <= bit < BITS. */
| 33 | * Note the parameter "bit" is an index to the bit, 0 <= bit < BITS. |
| 34 | */ |
| 35 | inline bool test(size_t bit) const |
| 36 | { |
| 37 | return (bit < BITS) ? mData[bit / WIDTH].test(bit % WIDTH) : false; |
| 38 | } |
| 39 | /* Returns total number of bytes needed for the array */ |
| 40 | inline size_t bytes() { return (BITS + CHAR_BIT - 1) / CHAR_BIT; } |
| 41 | /* Returns true if array contains any non-zero bit from the range defined by start and end |