Files
test2/source/blender/blenlib
Jacques Lucke 8be66a42c9 BLI: add utilities to find first (un)set bit in a bit span
This adds three new functions to find the first 0 or 1 bit in an arbitrarily
long bit span:

```cpp
blender::bits::find_first_0_index(BitSpan) -> std::optional<int64_t>
blender::bits::find_first_1_index(BitSpan) -> std::optional<int64_t>
blender::bits::find_first_1_index_expr(Expr, BitSpans...) -> std::optional<int64_t>
```

The two first ones are implemented in terms of the third. The `*_expr` variant
allows e.g. finding the first set bit when ORing two bit spans together without
computing the entire intermediate result first. Or it can be used to find the
first index where two bit spans are different.

Pull Request: https://projects.blender.org/blender/blender/pulls/134923
2025-02-21 13:36:03 +01:00
..
2025-02-19 17:23:37 +01:00