A bitset implementation backed by a single integer of type I.

Synopsis

Declared in <util/bitset.h>

template<typename I>
class IntBitSet;

Member Functions

Name

Description

IntBitSet [constructor]

Constructors

operator=

Assignment operators

Any

Check if any bits are 1.

Count

Compute the number of 1 bits in the bitset.

First

Find the first element (requires Any()).

IsSubsetOf

Check if bitset a is a subset of bitset b (= every 1 bit in a is also in b).

IsSupersetOf

Check if bitset a is a superset of bitset b (= every 1 bit in b is also in a).

Last

Find the last element (requires Any()).

None

Check if all bits are 0.

Overlaps

Check if the intersection between two sets is non‐empty.

Reset

Set a bit to 0.

Set

Set overloads

begin

Return an object that iterates over all 1 bits (++ and * only allowed when != end()).

end

Return a dummy object to compare Iterators with.

operator&=

Set this object's bits to be the binary AND between respective bits from this and a.

operator‐=

Set this object's bits to be the binary AND NOT between respective bits from this and a.

operator[]

Retrieve a bit at the given position.

operatorˆ=

Set this object's bits to be the binary XOR between respective bits from this and a.

operator|=

Set this object's bits to be the binary OR between respective bits from this and a.

Static Member Functions

Name

Description

Fill

Construct a bitset with bits 0..count‐1 (inclusive) set to 1.

Singleton

Construct a bitset with the singleton i.

Size

Return the number of bits that this object holds.

Friends

Name

Description

bitset_detail::swap

Swap two bitsets.

bitset_detail::operator==

Check if bitset a and bitset b are identical.

bitset_detail::operatorˆ

Return an object with the binary XOR between respective bits from a and b.

bitset_detail::operator‐

Return an object with the binary AND NOT between respective bits from a and b.

bitset_detail::operator|

Return an object with the binary OR between respective bits from a and b.

bitset_detail::operator&

Return an object with the binary AND between respective bits from a and b.

Created with MrDocs