This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of CD1 status.
Section: 19.9.2 [template.bitset] Status: CD1 Submitter: Martin Sebor Opened: 2007-06-22 Last modified: 2019-01-01
Priority: Not Prioritized
View all other issues in [template.bitset].
View all issues with CD1 status.
bitset class template provides the member function
any() to determine whether an object of the type has any
bits set, and the member function
none() to determine
whether all of an object's bits are clear. However, the template does
not provide a corresponding function to discover whether a
bitset object has all its bits set. While it is
possible, even easy, to obtain this information by comparing the
count() with the result of
for equality (i.e., via
b.count() == b.size()) the
operation is less efficient than a member function designed
specifically for that purpose could be. (
count all non-zero bits in a
bitset a word at a time
all() could stop counting as soon as it encountered
the first word with a zero bit).
Add a declaration of the new member function
all() to the
defintion of the
bitset template in 19.9.2 [template.bitset], p1,
right above the declaration of
any() as shown below:
bool operator!=(const bitset<N>& rhs) const; bool test(size_t pos) const; bool any() const; bool none() const;
Add a description of the new member function to the end of 18.104.22.168 [bitset.members] with the following text:
bool all() const;
count() == size().
In addition, change the description of
none() for consistency with
bool any() const;
trueif any bit in
bool none() const;
trueif no bit in