| 1597 | } |
| 1598 | |
| 1599 | inline bit_vector operator~(const bit_vector& a) |
| 1600 | { |
| 1601 | bit_vector result = a; |
| 1602 | // Flip all bits |
| 1603 | for (size_t i = 0; i < result.num_blocks(); i++) { |
| 1604 | result.data()[i] = ~result.data()[i]; |
| 1605 | } |
| 1606 | // Clear unused bits in last block |
| 1607 | if (result.size() % 64 != 0) { |
| 1608 | size_t unused_bits = 64 - (result.size() % 64); |
| 1609 | result.data()[result.num_blocks() - 1] = |
| 1610 | result.data()[result.num_blocks() - 1] & ((uint64_t(1) << (result.size() % 64)) - 1); |
| 1611 | } |
| 1612 | return result; |
| 1613 | } |
| 1614 | |
| 1615 | // Comparison operators |
| 1616 | inline bool operator==(const bit_vector& a, const bit_vector& b) |
nothing calls this directly
no test coverage detected