Check if all bits are set
| 278 | |
| 279 | // Check if all bits are set |
| 280 | bool all() const FL_NOEXCEPT { |
| 281 | if (_size == 0) |
| 282 | return true; |
| 283 | |
| 284 | if (!_blocks) return false; |
| 285 | |
| 286 | for (fl::u32 i = 0; i < _block_count - 1; ++i) { |
| 287 | if (_blocks[i] != static_cast<block_type>(~block_type(0))) |
| 288 | return false; |
| 289 | } |
| 290 | |
| 291 | // Check last block with mask for valid bits |
| 292 | if (_block_count > 0) { |
| 293 | fl::u32 last_bit_pos = (_size - 1) % bits_per_block; |
| 294 | block_type mask = |
| 295 | static_cast<block_type>((static_cast<block_type>(1) << (last_bit_pos + 1)) - 1); |
| 296 | return (_blocks[_block_count - 1] & mask) == mask; |
| 297 | } |
| 298 | |
| 299 | return true; |
| 300 | } |
| 301 | |
| 302 | // Get the size of the bitset |
| 303 | FL_DISABLE_WARNING_PUSH |
no outgoing calls