Test, Reset, and Set a bit in the bitmap.
| 744 | |
| 745 | // Test, Reset, and Set a bit in the bitmap. |
| 746 | bool test(unsigned Idx) const |
| 747 | { |
| 748 | if (Elements.empty()) |
| 749 | return false; |
| 750 | |
| 751 | unsigned ElementIndex = Idx / ElementSize; |
| 752 | ElementListConstIter ElementIter = FindLowerBoundConst(ElementIndex); |
| 753 | |
| 754 | // If we can't find an element that is supposed to contain this bit, there |
| 755 | // is nothing more to do. |
| 756 | if (ElementIter == Elements.end() || |
| 757 | ElementIter->index() != ElementIndex) |
| 758 | return false; |
| 759 | return ElementIter->test(Idx % ElementSize); |
| 760 | } |
| 761 | |
| 762 | void reset(unsigned Idx) |
| 763 | { |