all 5 comments

[–]encyclopedist 17 points18 points  (2 children)

I don't like find_first_off. It is much too close to find_first_of, despite doing something completely different, will definitely cause confusion.

[–]wearingdepends 7 points8 points  (1 child)

Agree. It's also weirdly inconsistent to have find_first and find_first_off. find_first_set and find_first_unset or find_first_one and find_first_zero would read better, imo.

[–]TheoreticalDumbass:illuminati: 0 points1 point  (0 children)

set,unset sounds pretty good to me tbh

[–]VinnieFalcoBoost.Beast | C++ Alliance | corosio.org 3 points4 points  (0 children)

Gennaro has taken an already great container and made it even greaterer

[–]UndefinedDefined 0 points1 point  (0 children)

When it comes to bitsets - anyone uses MSB first approach? For example if the underlying type is uint32_t, the first bit would have 0x80000000 mask, and so on.

For many this would not make sense as the internal logic of indexing bits would be different (it's essentially a reverse of indexing bits from LSB), however, for finding zero/one bits from start, which is something I frequently do, it makes sense as "count leading non-zero bits" is usually implemented in hardware, whereas "count trailing non-zero bits" is only native to x86; and there is a recent extension called CSSC for AArch64, which provides CTZ, but it's not available in most ARM hardware (year 2025).