STD::TR2::DYNAMIC_BITSET(3cxx)

๐Ÿ’… std::tr2::dynamic_bitset< _WordT, _Alloc > โ€” (3cxx) manual page ๐Ÿ’…

โœจ NAME โœจ

okay bestie, welcome to the (3cxx) manual page for std::tr2::dynamic_bitset< _WordT, _Alloc > ๐Ÿ’– โ€” the dynamic_bitset class represents a sequence of bits. periodt.


๐ŸŒˆ SYNOPSIS ๐ŸŒˆ

#include <dynamic_bitset>

Inherits std::tr2::__dynamic_bitset_base< _WordT, _Alloc >. no cap, that's the base-class situation ๐Ÿซถ

๐ŸŒธ Classes ๐ŸŒธ

  • class reference

๐Ÿ’– Public Types ๐Ÿ’–

  • typedef __dynamic_bitset_base< _WordT, _Alloc > _Base
  • typedef _Alloc allocator_type
  • typedef _WordT block_type
  • typedef bool const_reference
  • typedef size_t size_type

๐ŸŽ€ Public Member Functions ๐ŸŽ€

  • dynamic_bitset ()=default โ€” all bits set to zero โœจ
  • dynamic_bitset (const allocator_type &__alloc) โ€” all bits set to zero โœจ
  • dynamic_bitset (const char *__str, const allocator_type &__alloc=allocator_type()) โ€” construct from a string ๐Ÿงš
  • dynamic_bitset (const dynamic_bitset &)=default โ€” copy constructor, iconic behavior ๐Ÿ’…
  • the big string-subset constructor โ€” use a subset of a string:
template<typename _CharT , typename _Traits , typename _Alloc1 >
    dynamic_bitset (const std::basic_string< _CharT, _Traits, _Alloc1 >
    &__str, typename basic_string< _CharT, _Traits, _Alloc1 >::size_type
    __pos=0, typename basic_string< _CharT, _Traits, _Alloc1
    >::size_type __n=std::basic_string< _CharT, _Traits, _Alloc1
    >::npos, _CharT __zero=_CharT('0'), _CharT __one=_CharT('1'), const
    allocator_type &__alloc=allocator_type())
  • dynamic_bitset (dynamic_bitset &&__b) noexcept โ€” move constructor ๐Ÿฆ‹
  • dynamic_bitset (initializer_list< block_type > __il, const allocator_type &__alloc=allocator_type())
  • dynamic_bitset (size_type __nbits, unsigned long long __val=0ULL, const allocator_type &__alloc=allocator_type()) โ€” initial bits bitwise-copied from a single word (others set to zero) ๐Ÿ”ฅ
  • _M_copy_from_ptr โ€” exact signature:
template<typename _Traits  = std::char_traits<char>, typename _CharT  =
    typename _Traits::char_type> void _M_copy_from_ptr (const _CharT *,
    size_t, size_t, size_t, _CharT __zero=_CharT('0'), _CharT
    __one=_CharT('1'))
  • _M_copy_from_string โ€” exact signature:
template<typename _CharT , typename _Traits , typename _Alloc1 > void
    _M_copy_from_string (const basic_string< _CharT, _Traits, _Alloc1 >
    &__str, size_t __pos, size_t __n, _CharT __zero=_CharT('0'), _CharT
    __one=_CharT('1'))
  • _M_copy_to_string โ€” exact signature:
template<typename _CharT , typename _Traits , typename _Alloc1 > void
    _M_copy_to_string (std::basic_string< _CharT, _Traits, _Alloc1 >
    &__str, _CharT __zero=_CharT('0'), _CharT __one=_CharT('1')) const
  • bool all () const โ€” tests whether all the bits are on ๐ŸŒŸ
  • bool any () const โ€” tests whether any of the bits are on ๐ŸŒŸ
  • append time โ€” iterator-range version:
template<typename _BlockInputIterator > void append (_BlockInputIterator
    __first, _BlockInputIterator __last)

appends an iterator range of blocks ๐ŸŽ€

  • void append (block_type __block) โ€” appends a block ๐ŸŽ€
  • void append (initializer_list< block_type > __il)
  • void clear () โ€” clears the bitset ๐Ÿงน
  • size_type count () const noexcept โ€” returns the number of bits which are set ๐Ÿ”ข
  • bool empty () const noexcept โ€” returns true if the dynamic_bitset is empty ๐Ÿซง
  • size_type find_first () const โ€” finds the index of the first 'on' bit ๐Ÿ”
  • size_type find_next (size_t __prev) const โ€” finds the index of the next 'on' bit after prev ๐Ÿ”
  • dynamic_bitset & flip () โ€” toggles every bit to its opposite value ๐Ÿ”
  • dynamic_bitset & flip (size_type __pos) โ€” toggles a given bit to its opposite value ๐Ÿ”
  • allocator_type get_allocator () const noexcept โ€” return the allocator for the bitset ๐Ÿงบ
  • bool is_proper_subset_of (const dynamic_bitset &__b) const
  • bool is_subset_of (const dynamic_bitset &__b) const
  • constexpr size_type max_size () noexcept โ€” returns the maximum size of a dynamic_bitset object having the same type as *this. The real answer is max() * bits_per_block but is likely to overflow ๐Ÿ˜ญ
  • bool none () const โ€” tests whether any of the bits are on ๐ŸŒŸ
  • size_type num_blocks () const noexcept โ€” returns the total number of blocks ๐Ÿงฑ
  • dynamic_bitset & operator= (const dynamic_bitset &)=default โ€” copy assignment operator ๐Ÿ’…
  • dynamic_bitset & operator= (dynamic_bitset &&__b) noexcept(std::is_nothrow_move_assignable< _Base >::value) โ€” move assignment operator ๐Ÿ’…
  • dynamic_bitset operator~ () const โ€” see the no-argument flip() ๐Ÿ”
  • void push_back (bool __bit) โ€” push a bit onto the high end of the bitset ๐Ÿซถ
  • dynamic_bitset & reset () โ€” sets every bit to false ๐Ÿ™…
  • dynamic_bitset & reset (size_type __pos) โ€” sets a given bit to false ๐Ÿ™…
  • void resize (size_type __nbits, bool __value=false) โ€” resize the bitset ๐Ÿ“
  • dynamic_bitset & set () โ€” sets every bit to true โœ…
  • dynamic_bitset & set (size_type __pos, bool __val=true) โ€” sets a given bit to a particular value โœ…
  • size_type size () const noexcept โ€” returns the total number of bits ๐Ÿ”ข
  • void swap (dynamic_bitset &__b) noexcept โ€” swap with another bitset ๐Ÿ”„
  • bool test (size_type __pos) const โ€” tests the value of a bit ๐Ÿงช
  • to_string bestie โ€” returns a character interpretation of the dynamic_bitset:
template<typename _CharT  = char, typename _Traits  =
    std::char_traits<_CharT>, typename _Alloc1  =
    std::allocator<_CharT>> std::basic_string< _CharT, _Traits, _Alloc1
    > to_string (_CharT __zero=_CharT('0'), _CharT __one=_CharT('1'))
    const
  • unsigned long long to_ullong () const โ€” returns a numerical interpretation of the dynamic_bitset ๐Ÿ”ข
  • unsigned long to_ulong () const โ€” returns a numerical interpretation of the dynamic_bitset ๐Ÿ”ข

and now, the operator-y besties ๐Ÿ’…:

  • dynamic_bitset & operator&= (const dynamic_bitset &__rhs) โ€” operations on dynamic_bitsets ๐Ÿงฎ
  • dynamic_bitset & operator&= (dynamic_bitset &&__rhs) โ€” operations on dynamic_bitsets ๐Ÿงฎ
  • dynamic_bitset & operator|= (const dynamic_bitset &__rhs) โ€” operations on dynamic_bitsets ๐Ÿงฎ
  • dynamic_bitset & operator^= (const dynamic_bitset &__rhs) โ€” operations on dynamic_bitsets ๐Ÿงฎ
  • dynamic_bitset & operator-= (const dynamic_bitset &__rhs) โ€” operations on dynamic_bitsets ๐Ÿงฎ
  • dynamic_bitset & operator<<= (size_type __pos) โ€” operations on dynamic_bitsets ๐Ÿงฎ
  • dynamic_bitset & operator>>= (size_type __pos) โ€” operations on dynamic_bitsets ๐Ÿงฎ
  • reference operator[] (size_type __pos) โ€” array-indexing support ๐Ÿ”ข
  • const_reference operator[] (size_type __pos) const โ€” array-indexing support ๐Ÿ”ข
  • dynamic_bitset operator<< (size_type __pos) const โ€” self-explanatory ๐Ÿ’…
  • dynamic_bitset operator>> (size_type __pos) const โ€” self-explanatory ๐Ÿ’…

๐ŸŒŸ Static Public Attributes ๐ŸŒŸ

  • static const size_type bits_per_block
  • static const size_type npos

๐Ÿซถ Friends ๐Ÿซถ

  • bool operator< (const dynamic_bitset &__lhs, const dynamic_bitset &__rhs) noexcept
  • bool operator== (const dynamic_bitset &__lhs, const dynamic_bitset &__rhs) noexcept
  • class reference

๐Ÿ‘‘ Detailed Description ๐Ÿ‘‘

template<typename _WordT = unsigned long long, typename _Alloc =
    std::allocator<_WordT>>
class std::tr2::dynamic_bitset< _WordT, _Alloc >"The dynamic_bitset
class represents a sequence of bits.

See N2050, Proposal to Add a Dynamically Sizeable Bitset to the Standard Library. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2050.pdf ๐Ÿ“„โœจ

In the general unoptimized case, storage is allocated in word-sized blocks. Let B be the number of bits in a word, then (Nb+(B-1))/B words will be used for storage. B - NbB bits are unused. (They are the high-order bits in the highest word.) It is a class invariant that those unused bits are always zero. ๐Ÿ”’

If you think of dynamic_bitset as 'a simple array of bits,' be aware that your mental picture is reversed: a dynamic_bitset behaves the same way as bits in integers do, with the bit at index 0 in the 'least significant / right-hand' position, and the bit at index Nb-1 in the 'most significant / left-hand' position. Thus, unlike other containers, a dynamic_bitset's index 'counts from right to left,' to put it very loosely. ๐Ÿชž

This behavior is preserved when translating to and from strings. For example, the first line of the following program probably prints 'b('a') is 0001100001' on a modern ASCII system. ๐Ÿงช

#include <dynamic_bitset>
#include <iostream>
#include <sstream>

using namespace std;

int main()
{
    long         a = 'a';
    dynamic_bitset<> b(a);

    cout << "b('a') is " << b << endl;

    ostringstream s;
    s << b;
    string  str = s.str();
    cout << "index 3 in the string is " << str[3] << " but\n"
         << "index 3 in the bitset is " << b[3] << endl;
}

Most of the actual code isn't contained in dynamic_bitset<> itself, but in the base class __dynamic_bitset_base. The base class works with whole words, not with individual bits. This allows us to specialize __dynamic_bitset_base for the important special case where the dynamic_bitset is only a single word. ๐Ÿง 

Extra confusion can result due to the fact that the storage for __dynamic_bitset_base is a vector, and is indexed as such. This is carefully encapsulated. ๐ŸŽ

โœจ Constructor & Destructor Documentation โœจ

okay so this is the constructor zone ๐Ÿ› ๏ธโœจ same template prefix every time, and Iโ€™m keeping every default arg and attribute exactly because the facts do not move. ๐Ÿ’…

๐Ÿงธ dynamic_bitset() โ€” default constructor

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> std::tr2::dynamic_bitset< _WordT, _Alloc
    >::dynamic_bitset () [default]

All bits set to zero. ๐Ÿซถ

Referenced by std::tr2::dynamic_bitset< _WordT, _Alloc >::operator<<(), and std::tr2::dynamic_bitset< _WordT, _Alloc >::operator>>().

๐ŸŽ€ dynamic_bitset(const allocator_type &__alloc) โ€” allocator constructor

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> std::tr2::dynamic_bitset< _WordT, _Alloc
    >::dynamic_bitset (const allocator_type & __alloc) [inline],  [explicit]

All bits set to zero. โœจ

๐Ÿฆ‹ dynamic_bitset(size_type __nbits, unsigned long long __val = 0ULL, const allocator_type &__alloc = allocator_type())

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> std::tr2::dynamic_bitset< _WordT, _Alloc
    >::dynamic_bitset (size_type __nbits, unsigned long long __val = 0ULL,
    const allocator_type & __alloc = allocator_type()) [inline],  [explicit]

Initial bits bitwise-copied from a single word (others set to zero). ๐Ÿ”ฅ

๐ŸŒธ dynamic_bitset(const std::basic_string<...>& __str, ...) โ€” subset-of-string constructor

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> template<typename _CharT , typename _Traits ,
    typename _Alloc1 > std::tr2::dynamic_bitset< _WordT, _Alloc
    >::dynamic_bitset (const std::basic_string< _CharT, _Traits, _Alloc1 > &
    __str, typename basic_string< _CharT, _Traits, _Alloc1 >::size_type
    __pos = 0, typename basic_string< _CharT, _Traits, _Alloc1 >::size_type
    __n = std::basic_string<_CharT, _Traits, _Alloc1>::npos, _CharT __zero =
    _CharT('0'), _CharT __one = _CharT('1'), const allocator_type & __alloc
    = allocator_type()) [inline],  [explicit]

Use a subset of a string. โœจ

Parameters

  • __str โ€” A string of '0' and '1' characters.
  • __pos โ€” Index of the first character in __str to use.
  • __n โ€” The number of characters to copy.
  • __zero โ€” The character to use for unset bits.
  • __one โ€” The character to use for set bits.
  • __alloc โ€” An allocator.

Exceptions

  • std::out_of_range โ€” If __pos is bigger the size of __str.
  • std::invalid_argument โ€” If a character appears in the string which is neither '0' nor '1'.

References std::tr2::dynamic_bitset< _WordT, _Alloc >::resize(), and std::basic_string< _CharT, _Traits, _Alloc >::size().

๐Ÿ“ dynamic_bitset(const char *__str, const allocator_type &__alloc = allocator_type())

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> std::tr2::dynamic_bitset< _WordT, _Alloc
    >::dynamic_bitset (const char * __str, const allocator_type & __alloc =
    allocator_type()) [inline],  [explicit]

Construct from a string. ๐Ÿ’–

Parameters

  • __str โ€” A string of '0' and '1' characters.
  • __alloc โ€” An allocator.

Exceptions

  • std::invalid_argument โ€” If a character appears in the string which is neither '0' nor '1'.

๐Ÿงš dynamic_bitset(const dynamic_bitset<_WordT, _Alloc>&) โ€” copy constructor

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> std::tr2::dynamic_bitset< _WordT, _Alloc
    >::dynamic_bitset (const dynamic_bitset< _WordT, _Alloc > &) [default]

Copy constructor. ๐Ÿซถ

๐Ÿ’œ dynamic_bitset(dynamic_bitset<_WordT, _Alloc>&& __b) โ€” move constructor

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> std::tr2::dynamic_bitset< _WordT, _Alloc
    >::dynamic_bitset (dynamic_bitset< _WordT, _Alloc > && __b) [inline],
    [noexcept]

Move constructor. ๐Ÿ˜ญ๐Ÿ”ฅ


โœจ Member Function Documentation โœจ

๐Ÿ‘‘ all() const

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> bool std::tr2::dynamic_bitset< _WordT, _Alloc
    >::all () const [inline]

Tests whether all the bits are on. ๐Ÿ‘‘

Returns True if all the bits are set.

๐ŸŒˆ any() const

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> bool std::tr2::dynamic_bitset< _WordT, _Alloc
    >::any () const [inline]

Tests whether any of the bits are on. ๐ŸŒˆ

Returns True if at least one bit is set.

๐Ÿฆ‹ append(_BlockInputIterator __first, _BlockInputIterator __last)

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> template<typename _BlockInputIterator > void
    std::tr2::dynamic_bitset< _WordT, _Alloc >::append (_BlockInputIterator
    __first, _BlockInputIterator __last) [inline]

Append an iterator range of blocks. โœจ

References std::tr2::dynamic_bitset< _WordT, _Alloc >::append().

๐ŸŽ€ append(block_type __block)

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> void std::tr2::dynamic_bitset< _WordT, _Alloc
    >::append (block_type __block) [inline]

Append a block. ๐Ÿ’…

Referenced by std::tr2::dynamic_bitset< _WordT, _Alloc >::append().

๐Ÿงน clear()

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> void std::tr2::dynamic_bitset< _WordT, _Alloc
    >::clear () [inline]

Clear the bitset. ๐Ÿงน

๐Ÿ”ข count() const

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> size_type std::tr2::dynamic_bitset< _WordT,
    _Alloc >::count () const [inline],  [noexcept]

Returns the number of bits which are set. ๐Ÿ”ข

๐Ÿซง empty() const

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> bool std::tr2::dynamic_bitset< _WordT, _Alloc
    >::empty () const [inline],  [noexcept]

Returns true if the dynamic_bitset is empty. ๐Ÿซง

๐Ÿ”Ž find_first() const

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> size_type std::tr2::dynamic_bitset< _WordT,
    _Alloc >::find_first () const [inline]

Finds the index of the first 'on' bit. ๐Ÿ”Ž

Returns The index of the first bit set, or size() if not found.

See also find_next

๐Ÿ” find_next(size_t __prev) const

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> size_type std::tr2::dynamic_bitset< _WordT,
    _Alloc >::find_next (size_t __prev) const [inline]

Finds the index of the next 'on' bit after prev. ๐Ÿ”

Returns The index of the next bit set, or size() if not found.

Parameters

  • __prev โ€” Where to start searching.

See also find_first

๐Ÿ” flip()

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> dynamic_bitset & std::tr2::dynamic_bitset<
    _WordT, _Alloc >::flip () [inline]

Toggles every bit to its opposite value. ๐Ÿ”

Referenced by std::tr2::dynamic_bitset< _WordT, _Alloc >::operator~().

๐Ÿ”‚ flip(size_type __pos)

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> dynamic_bitset & std::tr2::dynamic_bitset<
    _WordT, _Alloc >::flip (size_type __pos) [inline]

Toggles a given bit to its opposite value. ๐Ÿ”‚

Parameters

  • __pos โ€” The index of the bit.

Exceptions

  • std::out_of_range โ€” If __pos is bigger the size of the set.

๐ŸŽ get_allocator() const

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> allocator_type std::tr2::dynamic_bitset< _WordT,
    _Alloc >::get_allocator () const [inline],  [noexcept]

Return the allocator for the bitset. ๐ŸŽ

Referenced by std::tr2::dynamic_bitset< _WordT, _Alloc >::operator=().

๐Ÿ“ max_size()

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> constexpr size_type std::tr2::dynamic_bitset<
    _WordT, _Alloc >::max_size () [inline],  [constexpr],  [noexcept]

Returns the maximum size of a dynamic_bitset object having the same type as *this. The real answer is max() * bits_per_block but is likely to overflow. ๐Ÿ˜ญ

References std::numeric_limits< _Tp >::max().

๐Ÿšซ none() const

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> bool std::tr2::dynamic_bitset< _WordT, _Alloc
    >::none () const [inline]

The docs literally say โ€œTests whether any of the bits are on.โ€ for none() ๐Ÿ˜ญ (thatโ€™s the original wording, bestie).

Returns True if none of the bits are set.

๐Ÿงฑ num_blocks() const

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> size_type std::tr2::dynamic_bitset< _WordT,
    _Alloc >::num_blocks () const [inline],  [noexcept]

Returns the total number of blocks. ๐Ÿงฑ

๐Ÿงท operator&=(const dynamic_bitset<_WordT, _Alloc>& __rhs)

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> dynamic_bitset & std::tr2::dynamic_bitset<
    _WordT, _Alloc >::operator&= (const dynamic_bitset< _WordT, _Alloc > &
    __rhs) [inline]

Operations on dynamic_bitsets. ๐Ÿงท

Parameters

  • __rhs โ€” A same-sized dynamic_bitset.

These should be self-explanatory. ๐Ÿ’…

๐Ÿงท operator&=(dynamic_bitset<_WordT, _Alloc>&& __rhs)

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> dynamic_bitset & std::tr2::dynamic_bitset<
    _WordT, _Alloc >::operator&= (dynamic_bitset< _WordT, _Alloc > && __rhs)
    [inline]

Operations on dynamic_bitsets. ๐Ÿงท

Parameters

  • __rhs โ€” A same-sized dynamic_bitset.

These should be self-explanatory. ๐Ÿ’…

References std::move().

โž– operator-=(const dynamic_bitset<_WordT, _Alloc>& __rhs)

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> dynamic_bitset & std::tr2::dynamic_bitset<
    _WordT, _Alloc >::operator-= (const dynamic_bitset< _WordT, _Alloc > &
    __rhs) [inline]

Operations on dynamic_bitsets. โž–

Parameters

  • __rhs โ€” A same-sized dynamic_bitset.

These should be self-explanatory. ๐Ÿ’…

โฌ…๏ธ operator<<(size_type __pos) const

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> dynamic_bitset std::tr2::dynamic_bitset< _WordT,
    _Alloc >::operator<< (size_type __pos) const [inline]

Self-explanatory. ๐Ÿซถ

References std::tr2::dynamic_bitset< _WordT, _Alloc >::dynamic_bitset().

โฌ…๏ธ operator<<=(size_type __pos)

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> dynamic_bitset & std::tr2::dynamic_bitset<
    _WordT, _Alloc >::operator<<= (size_type __pos) [inline]

Operations on dynamic_bitsets. โฌ…๏ธ

Parameters

  • __pos โ€” The number of places to shift.

These should be self-explanatory. ๐Ÿ’…

๐Ÿ“ operator=(const dynamic_bitset<_WordT, _Alloc>&)

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> dynamic_bitset & std::tr2::dynamic_bitset<
    _WordT, _Alloc >::operator= (const dynamic_bitset< _WordT, _Alloc > &)
    [default]

Copy assignment operator. ๐Ÿ“

๐Ÿ“ operator=(dynamic_bitset<_WordT, _Alloc>&& __b)

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> dynamic_bitset & std::tr2::dynamic_bitset<
    _WordT, _Alloc >::operator= (dynamic_bitset< _WordT, _Alloc > && __b)
    [inline],  [noexcept]

Move assignment operator. ๐Ÿ“

References std::tr2::dynamic_bitset< _WordT, _Alloc >::get_allocator().

โžก๏ธ operator>>(size_type __pos) const

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> dynamic_bitset std::tr2::dynamic_bitset< _WordT,
    _Alloc >::operator>> (size_type __pos) const [inline]

Self-explanatory. ๐Ÿซถ

References std::tr2::dynamic_bitset< _WordT, _Alloc >::dynamic_bitset().

โžก๏ธ operator>>=(size_type __pos)

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> dynamic_bitset & std::tr2::dynamic_bitset<
    _WordT, _Alloc >::operator>>= (size_type __pos) [inline]

Operations on dynamic_bitsets. โžก๏ธ

Parameters

  • __pos โ€” The number of places to shift.

These should be self-explanatory. ๐Ÿ’…

๐ŸŽฏ operator[](size_type __pos)

template<typename _WordT  = unsigned long long, typename _Alloc  =
    std::allocator<_WordT>> reference std::tr2::dynamic_bitset< _WordT,
    _Alloc >::operator[] (size_type __pos) [inline]

Array-indexing support. ๐ŸŽฏ

Parameters

  • __pos โ€” Index into the dynamic_bitset.

Returns A bool for a 'const dynamic_bitset'. For non-const bitsets, an instance of the reference proxy class.

โš ๏ธ Note These operators do no range checking and throw no exceptions, as required by DR 11 to the standard.

๐Ÿ’… operator[] (const one) โ€” array-indexing support, periodt

   template<typename _WordT  = unsigned long long, typename _Alloc  =
       std::allocator<_WordT>> const_reference std::tr2::dynamic_bitset<
       _WordT, _Alloc >::operator[] (size_type __pos) const [inline]

Array-indexing support, bestie โ€” this is the const flavor of indexing into the bitset.

Parameters

  • __pos โ€” index into the dynamic_bitset.

Returns

A bool for a 'const dynamic_bitset'. For non-const bitsets, an instance of the reference proxy class.

Note ๐Ÿšจ These operators do no range checking and throw no exceptions, as required by DR 11 to the standard. No cap, that's literally the rule.

๐Ÿ”ฅ operator^=

   template<typename _WordT  = unsigned long long, typename _Alloc  =
       std::allocator<_WordT>> dynamic_bitset & std::tr2::dynamic_bitset<
       _WordT, _Alloc >::operator^= (const dynamic_bitset< _WordT, _Alloc > &
       __rhs) [inline]

Operations on dynamic_bitsets โ€” yes, this is one of them. ๐Ÿ’…

Parameters

  • __rhs โ€” a same-sized dynamic_bitset.

These should be self-explanatory (fr fr).


โœจ operator|=

   template<typename _WordT  = unsigned long long, typename _Alloc  =
       std::allocator<_WordT>> dynamic_bitset & std::tr2::dynamic_bitset<
       _WordT, _Alloc >::operator|= (const dynamic_bitset< _WordT, _Alloc > &
       __rhs) [inline]

Operations on dynamic_bitsets โ€” same iconic energy, different operator. ๐ŸŒˆ

Parameters

  • __rhs โ€” a same-sized dynamic_bitset.

These should be self-explanatory (no notes needed, bestie).


๐Ÿฆ‹ operator~

   template<typename _WordT  = unsigned long long, typename _Alloc  =
       std::allocator<_WordT>> dynamic_bitset std::tr2::dynamic_bitset< _WordT,
       _Alloc >::operator~ () const [inline]

See the no-argument flip(). That's the whole vibe.

References

std::tr2::dynamic_bitset< _WordT, _Alloc >::flip()


๐ŸŽ€ push_back

   template<typename _WordT  = unsigned long long, typename _Alloc  =
       std::allocator<_WordT>> void std::tr2::dynamic_bitset< _WordT, _Alloc
       >::push_back (bool __bit) [inline]

Push a bit onto the high end of the bitset. ๐Ÿซถ

References

std::tr2::dynamic_bitset< _WordT, _Alloc >::size()


๐ŸŒธ reset()

   template<typename _WordT  = unsigned long long, typename _Alloc  =
       std::allocator<_WordT>> dynamic_bitset & std::tr2::dynamic_bitset<
       _WordT, _Alloc >::reset () [inline]

Sets every bit to false. Clean slate, zero drama. ๐Ÿ’€


๐Ÿ“ reset(size_type __pos)

   template<typename _WordT  = unsigned long long, typename _Alloc  =
       std::allocator<_WordT>> dynamic_bitset & std::tr2::dynamic_bitset<
       _WordT, _Alloc >::reset (size_type __pos) [inline]

Sets a given bit to false.

Parameters

  • __pos โ€” the index of the bit.

Exceptions

  • std::out_of_range โ€” if __pos is bigger the size of the set.

Same as writing set(__pos, false).


๐Ÿงš resize

   template<typename _WordT  = unsigned long long, typename _Alloc  =
       std::allocator<_WordT>> void std::tr2::dynamic_bitset< _WordT, _Alloc
       >::resize (size_type __nbits, bool __value = false) [inline]

Resize the bitset.

Referenced by

std::tr2::dynamic_bitset< _WordT, _Alloc >::dynamic_bitset(), and std::tr2::operator>>().


๐Ÿ’œ set()

   template<typename _WordT  = unsigned long long, typename _Alloc  =
       std::allocator<_WordT>> dynamic_bitset & std::tr2::dynamic_bitset<
       _WordT, _Alloc >::set () [inline]

Sets every bit to true. Main character energy only. ๐Ÿ‘‘


โญ set(size_type __pos, bool __val = true)

   template<typename _WordT  = unsigned long long, typename _Alloc  =
       std::allocator<_WordT>> dynamic_bitset & std::tr2::dynamic_bitset<
       _WordT, _Alloc >::set (size_type __pos, bool __val = true) [inline]

Sets a given bit to a particular value.

Parameters

  • __pos โ€” the index of the bit.
  • __val โ€” either true or false, defaults to true.

Exceptions

  • std::out_of_range โ€” if __pos is bigger the size of the set.

๐ŸŒˆ size

   template<typename _WordT  = unsigned long long, typename _Alloc  =
       std::allocator<_WordT>> size_type std::tr2::dynamic_bitset< _WordT,
       _Alloc >::size () const [inline],  [noexcept]

Returns the total number of bits.

Referenced by

std::tr2::operator>>(), and std::tr2::dynamic_bitset< _WordT, _Alloc >::push_back().


๐Ÿซถ swap

   template<typename _WordT  = unsigned long long, typename _Alloc  =
       std::allocator<_WordT>> void std::tr2::dynamic_bitset< _WordT, _Alloc
       >::swap (dynamic_bitset< _WordT, _Alloc > & __b) [inline],  [noexcept]

Swap with another bitset. Tradesies, but make it efficient. โœจ


๐Ÿ”ฅ test

   template<typename _WordT  = unsigned long long, typename _Alloc  =
       std::allocator<_WordT>> bool std::tr2::dynamic_bitset< _WordT, _Alloc
       >::test (size_type __pos) const [inline]

Tests the value of a bit.

Parameters

  • __pos โ€” the index of a bit.

Returns

The value at __pos.

Exceptions

  • std::out_of_range โ€” if __pos is bigger the size of the set.

๐Ÿ’– to_string

   template<typename _WordT  = unsigned long long, typename _Alloc  =
       std::allocator<_WordT>> template<typename _CharT  = char, typename
       _Traits  = std::char_traits<_CharT>, typename _Alloc1  =
       std::allocator<_CharT>> std::basic_string< _CharT, _Traits, _Alloc1 >
       std::tr2::dynamic_bitset< _WordT, _Alloc >::to_string (_CharT __zero =
       _CharT('0'), _CharT __one = _CharT('1')) const [inline]

Returns a character interpretation of the dynamic_bitset.

Returns

The string equivalent of the bits.

Note ๐Ÿ“ the ordering of the bits: decreasing character positions correspond to increasing bit positions (see the main class notes for an example). It's giving fancy, but it's consistent, okay?

๐Ÿฆ‹ to_ullong

   template<typename _WordT  = unsigned long long, typename _Alloc  =
       std::allocator<_WordT>> unsigned long long std::tr2::dynamic_bitset<
       _WordT, _Alloc >::to_ullong () const [inline]

Returns a numerical interpretation of the dynamic_bitset.

Returns

The integral equivalent of the bits.

Exceptions

  • std::overflow_error โ€” if there are too many bits to be represented in an unsigned long.

๐Ÿงš to_ulong

   template<typename _WordT  = unsigned long long, typename _Alloc  =
       std::allocator<_WordT>> unsigned long std::tr2::dynamic_bitset< _WordT,
       _Alloc >::to_ulong () const [inline]

Returns a numerical interpretation of the dynamic_bitset.

Returns

The integral equivalent of the bits.

Exceptions

  • std::overflow_error โ€” if there are too many bits to be represented in an unsigned long.

๐Ÿ‘‘ Author

Generated automatically by Doxygen for libstdc++ from the source code.


That's the footer tea, bestie: source/version is the libstdc++ (3cxx) page situation, and the date is exactly whatever that footer printed โ€” not me copying the line, just giving you the cute sign-off. Byeeee ๐Ÿ’–โœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from