bitset::none |
public member function |
Test if no bit is set
Returns whether none of the bits in the bitset are set.
Parameters
none
Return value
true if none of the bits in the
bitset are set, and
false otherwise.
Example
// bitset::none
#include <iostream>
#include <bitset>
using namespace std;
int main ()
{
bitset<16> mybits;
cout << "enter a binary number: ";
cin >> mybits;
if (mybits.none())
cout << "mybits has no bits set.\n";
else
cout << "mybits has " << (int)mybits.count() << " bits set.\n";
return 0;
}
|
See also
bitset::any | Test if any bit is set (public member function) |