boost::dynamic_bitset::operator[]

Subscript operators

Synopses

Declared in <boost/dynamic_bitset/dynamic_bitset.hpp>

Returns a reference to the bit at position pos.

The same as test( pos ).

bool
operator[](size_type pos) const;

Return Value

  • A reference to bit pos. Note that reference is a proxy class with an assignment operator and a conversion to bool, which allows you to use operator[] for assignment. That is, you can write both x = b[ n ] and b[ n ] = x. However, in many other respects the proxy is not the same as the true reference type bool &.

  • The same as test( pos ).

Preconditions

  • pos < this‐>size().

Created with MrDocs