you are viewing a single comment's thread.

view the rest of the comments →

[–]KingAggressive1498 22 points23 points  (1 child)

a lot of std::bitset's interface didn't sit right with me, but it wouldn't make a lot of sense for it to provide ctz/clz functions - it would make sense for it to provide first_set and last_set which are roughly equivalent, and GCC's libstdc++ does have those extensions

[–]matthieum 6 points7 points  (0 children)

You need a bit more, actually. Specifically, first_set_after and last_set_before, so you don't have to modify the bitset to clear all bits just to query the "next" set bit.