C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Finding the first/next set bit in a bitset

From: Jan Schultke <janschultke_at_[hidden]>
Date: Wed, 21 May 2025 23:11:38 +0200
"A possible issue is that this operation is extremely specialized towards
iteration." comment, I don't see that as a problem, but that's just
my opinion.


The issue is mainly that it's adding a very weird member function that only
exists because we don't have a proper bit iterator/range/view for
std::bitset yet. The moment something better gets added, this function
would be obsolete.

The other options are more justifiable because counting zeros, possibly at
a start index, is a general purpose operation. Once you bunch an increment
and extra checks into it, the design is no longer easy to justify.

Received on 2025-05-21 21:11:53