mirror of
https://github.com/boostorg/dynamic_bitset.git
synced 2026-01-19 04:12:09 +00:00
hyperlinked synopsis with the detailed documentation
[SVN r14644]
This commit is contained in:
@@ -99,11 +99,11 @@ template <typename Block, typename Allocator>
|
||||
class dynamic_bitset
|
||||
{
|
||||
public:
|
||||
typedef Block block_type;
|
||||
typedef <i>implementation-defined</i> size_type;
|
||||
enum { block_size = CHAR_BIT * sizeof(Block) };
|
||||
typedef Block <a href="#block_type">block_type</a>;
|
||||
typedef <i>implementation-defined</i> <a href="#size_type">size_type</a>;
|
||||
enum { <a href="#block_size">block_size</a> = CHAR_BIT * sizeof(Block) };
|
||||
|
||||
class reference
|
||||
class <a href="#reference">reference</a>
|
||||
{
|
||||
public:
|
||||
// An automatically generated copy constructor.
|
||||
@@ -121,135 +121,114 @@ public:
|
||||
operator bool() const;
|
||||
reference& flip();
|
||||
};
|
||||
typedef bool const_reference;
|
||||
typedef bool <a href="#const_reference">const_reference</a>;
|
||||
|
||||
explicit dynamic_bitset(const Allocator& alloc = Allocator());
|
||||
explicit <a href="#cons1">dynamic_bitset</a>(const Allocator& alloc = Allocator());
|
||||
|
||||
explicit dynamic_bitset(size_type num_bits, unsigned long value = 0,
|
||||
explicit <a href="#cons2">dynamic_bitset</a>(size_type num_bits, unsigned long value = 0,
|
||||
const Allocator& alloc = Allocator());
|
||||
|
||||
template <typename CharT, typename Traits, typename Alloc>
|
||||
explicit dynamic_bitset(const std::basic_string<CharT, Traits, Alloc>& s,
|
||||
explicit <a href="#cons3">dynamic_bitset</a>(const std::basic_string<CharT, Traits, Alloc>& s,
|
||||
typename std::basic_string<CharT, Traits, Alloc>::size_type pos = 0,
|
||||
typename std::basic_string<CharT, Traits, Alloc>::size_type n
|
||||
= std::basic_string<CharT, Traits, Alloc>::npos,
|
||||
typename std::basic_string<CharT, Traits, Alloc>::size_type n = std::basic_string<CharT, Traits, Alloc>::npos,
|
||||
const Allocator& alloc = Allocator());
|
||||
|
||||
template <typename BlockInputIterator>
|
||||
dynamic_bitset(BlockInputIterator first, BlockInputIterator last,
|
||||
<a href="#cons4">dynamic_bitset</a>(BlockInputIterator first, BlockInputIterator last,
|
||||
const Allocator& alloc = Allocator());
|
||||
|
||||
dynamic_bitset(const dynamic_bitset& b);
|
||||
<a href="#cons5">dynamic_bitset</a>(const dynamic_bitset& b);
|
||||
|
||||
void swap(dynamic_bitset& b);
|
||||
void <a href="#swap">swap</a>(dynamic_bitset& b);
|
||||
|
||||
dynamic_bitset& operator=(const dynamic_bitset& b);
|
||||
dynamic_bitset& <a href="#assign">operator=</a>(const dynamic_bitset& b);
|
||||
|
||||
void resize(size_type num_bits, bool value = false);
|
||||
void clear();
|
||||
void push_back(bool bit);
|
||||
void append(Block block);
|
||||
void <a href="#resize">resize</a>(size_type num_bits, bool value = false);
|
||||
void <a href="#clear">clear</a>();
|
||||
void <a href="#push_back">push_back</a>(bool bit);
|
||||
void <a href="#append1">append</a>(Block block);
|
||||
template <typename BlockInputIterator>
|
||||
void append(BlockInputIterator first, BlockInputIterator last);
|
||||
void <a href="#append2">append</a>(BlockInputIterator first, BlockInputIterator last);
|
||||
|
||||
dynamic_bitset& operator&=(const dynamic_bitset& b);
|
||||
dynamic_bitset& operator|=(const dynamic_bitset& b);
|
||||
dynamic_bitset& operator^=(const dynamic_bitset& b);
|
||||
dynamic_bitset& operator-=(const dynamic_bitset& b);
|
||||
dynamic_bitset& operator<<=(size_type n);
|
||||
dynamic_bitset& operator>>=(size_type n);
|
||||
dynamic_bitset operator<<(size_type n) const;
|
||||
dynamic_bitset operator>>(size_type n) const;
|
||||
dynamic_bitset& <a href="#op-and-assign">operator&=</a>(const dynamic_bitset& b);
|
||||
dynamic_bitset& <a href="#op-or-assign">operator|=</a>(const dynamic_bitset& b);
|
||||
dynamic_bitset& <a href="#op-xor-assign">operator^=</a>(const dynamic_bitset& b);
|
||||
dynamic_bitset& <a href="#op-sub-assign">operator-=</a>(const dynamic_bitset& b);
|
||||
dynamic_bitset& <a href="#op-sl-assign">operator<<=</a>(size_type n);
|
||||
dynamic_bitset& <a href="#op-sr-assign">operator>>=</a>(size_type n);
|
||||
dynamic_bitset <a href="#op-sl">operator<<</a>(size_type n) const;
|
||||
dynamic_bitset <a href="#op-sr">operator>></a>(size_type n) const;
|
||||
|
||||
dynamic_bitset& set(size_type n, bool val = true);
|
||||
dynamic_bitset& set();
|
||||
dynamic_bitset& reset(size_type n);
|
||||
dynamic_bitset& reset();
|
||||
dynamic_bitset& flip(size_type n);
|
||||
dynamic_bitset& flip();
|
||||
bool test(size_type n) const;
|
||||
bool any() const;
|
||||
bool none() const;
|
||||
dynamic_bitset operator~() const;
|
||||
size_type count() const;
|
||||
dynamic_bitset& <a href="#set2">set</a>(size_type n, bool val = true);
|
||||
dynamic_bitset& <a href="#set1">set</a>();
|
||||
dynamic_bitset& <a href="#reset2">reset</a>(size_type n);
|
||||
dynamic_bitset& <a href="#reset1">reset</a>();
|
||||
dynamic_bitset& <a href="#flip2">flip</a>(size_type n);
|
||||
dynamic_bitset& <a href="#flip1">flip</a>();
|
||||
bool <a href="#test">test</a>(size_type n) const;
|
||||
bool <a href="#any">any</a>() const;
|
||||
bool <a href="#none">none</a>() const;
|
||||
dynamic_bitset <a href="#op-not">operator~</a>() const;
|
||||
size_type <a href="#count">count</a>() const;
|
||||
|
||||
reference operator[](size_type pos) { return reference(*this, pos); }
|
||||
bool operator[](size_type pos) const { return test(pos); }
|
||||
reference <a href="#bracket">operator[]</a>(size_type pos) { return reference(*this, pos); }
|
||||
bool <a href="#const-bracket">operator[]</a>(size_type pos) const { return test(pos); }
|
||||
|
||||
unsigned long to_ulong() const;
|
||||
unsigned long <a href="#to_ulong">to_ulong</a>() const;
|
||||
|
||||
size_type size() const;
|
||||
|
||||
template <typename B, typename A>
|
||||
friend bool operator==(const dynamic_bitset<B, A>& a,
|
||||
const dynamic_bitset<B, A>& b);
|
||||
template <typename B, typename A>
|
||||
friend bool operator<(const dynamic_bitset<B, A>& a,
|
||||
const dynamic_bitset<B, A>& b);
|
||||
template <typename B, typename A>
|
||||
friend bool operator>(const dynamic_bitset<B, A>& a,
|
||||
const dynamic_bitset<B, A>& b);
|
||||
|
||||
template <typename B, typename A, typename BlockOutputIterator>
|
||||
friend void to_block_range(const dynamic_bitset<B, A>& b,
|
||||
BlockOutputIterator result);
|
||||
size_type <a href="#size">size</a>() const;
|
||||
};
|
||||
|
||||
template <typename Block, typename Allocator>
|
||||
bool operator!=(const dynamic_bitset<Block, Allocator>& a,
|
||||
const dynamic_bitset<Block, Allocator>& b);
|
||||
template <typename B, typename A>
|
||||
bool <a href="#op-equal">operator==</a>(const dynamic_bitset<B, A>& a, const dynamic_bitset<B, A>& b);
|
||||
|
||||
template <typename Block, typename Allocator>
|
||||
bool operator<=(const dynamic_bitset<Block, Allocator>& a,
|
||||
const dynamic_bitset<Block, Allocator>& b);
|
||||
bool <a href="#op-not-equal">operator!=</a>(const dynamic_bitset<Block, Allocator>& a, const dynamic_bitset<Block, Allocator>& b);
|
||||
|
||||
template <typename B, typename A>
|
||||
bool <a href="#op-less">operator<</a>(const dynamic_bitset<B, A>& a, const dynamic_bitset<B, A>& b);
|
||||
|
||||
template <typename Block, typename Allocator>
|
||||
bool operator>(const dynamic_bitset<Block, Allocator>& a,
|
||||
const dynamic_bitset<Block, Allocator>& b);
|
||||
bool <a href="#op-less-equal">operator<=</a>(const dynamic_bitset<Block, Allocator>& a, const dynamic_bitset<Block, Allocator>& b);
|
||||
|
||||
template <typename Block, typename Allocator>
|
||||
bool operator>=(const dynamic_bitset<Block, Allocator>& a,
|
||||
const dynamic_bitset<Block, Allocator>& b);
|
||||
bool <a href="#op-greater">operator></a>(const dynamic_bitset<Block, Allocator>& a, const dynamic_bitset<Block, Allocator>& b);
|
||||
|
||||
template <typename CharT, typename Traits, typename Block, typename Allocator>
|
||||
std::basic_ostream<CharT, Traits>&
|
||||
operator<<(std::basic_ostream<CharT, Traits>& os,
|
||||
const dynamic_bitset<Block, Allocator>& b);
|
||||
|
||||
template <typename CharT, typename Traits, typename Block, typename Allocator>
|
||||
std::basic_istream<CharT, Traits>&
|
||||
operator>>(std::basic_istream<CharT, Traits>& is,
|
||||
dynamic_bitset<Block, Allocator>& b);
|
||||
template <typename Block, typename Allocator>
|
||||
bool <a href="#op-greater-equal">operator>=</a>(const dynamic_bitset<Block, Allocator>& a, const dynamic_bitset<Block, Allocator>& b);
|
||||
|
||||
template <typename Block, typename Allocator>
|
||||
dynamic_bitset<Block, Allocator>
|
||||
operator&(const dynamic_bitset<Block, Allocator>& b1,
|
||||
const dynamic_bitset<Block, Allocator>& b2);
|
||||
<a href="#op-and">operator&</a>(const dynamic_bitset<Block, Allocator>& b1, const dynamic_bitset<Block, Allocator>& b2);
|
||||
|
||||
template <typename Block, typename Allocator>
|
||||
dynamic_bitset<Block, Allocator>
|
||||
operator|(const dynamic_bitset<Block, Allocator>& b1,
|
||||
const dynamic_bitset<Block, Allocator>& b2);
|
||||
<a href="#op-or">operator|</a>(const dynamic_bitset<Block, Allocator>& b1, const dynamic_bitset<Block, Allocator>& b2);
|
||||
|
||||
template <typename Block, typename Allocator>
|
||||
dynamic_bitset<Block, Allocator>
|
||||
operator^(const dynamic_bitset<Block, Allocator>& b1,
|
||||
const dynamic_bitset<Block, Allocator>& b2);
|
||||
<a href="#op-xor">operator^</a>(const dynamic_bitset<Block, Allocator>& b1, const dynamic_bitset<Block, Allocator>& b2);
|
||||
|
||||
template <typename Block, typename Allocator>
|
||||
dynamic_bitset<Block, Allocator>
|
||||
operator-(const dynamic_bitset<Block, Allocator>& b1,
|
||||
const dynamic_bitset<Block, Allocator>& b2);
|
||||
<a href="#op-sub">operator-</a>(const dynamic_bitset<Block, Allocator>& b1, const dynamic_bitset<Block, Allocator>& b2);
|
||||
|
||||
template <typename Block, typename Allocator, typename CharT, typename Alloc>
|
||||
void
|
||||
to_string(const dynamic_bitset<Block, Allocator>& b,
|
||||
void <a href="#to_string">to_string</a>(const dynamic_bitset<Block, Allocator>& b,
|
||||
std::basic_string<CharT, Alloc>& s);
|
||||
|
||||
template <typename Block, typename Allocator, typename BlockOutputIterator>
|
||||
void
|
||||
to_block_range(const dynamic_bitset<Block, Allocator>& b,
|
||||
BlockOutputIterator result);
|
||||
void to_block_range(const dynamic_bitset<Block, Allocator>& b,
|
||||
BlockOutputIterator result);
|
||||
|
||||
template <typename CharT, typename Traits, typename Block, typename Allocator>
|
||||
std::basic_ostream<CharT, Traits>&
|
||||
<a href="#op-out">operator<<</a>(std::basic_ostream<CharT, Traits>& os, const dynamic_bitset<Block, Allocator>& b);
|
||||
|
||||
template <typename CharT, typename Traits, typename Block, typename Allocator>
|
||||
std::basic_istream<CharT, Traits>&
|
||||
<a href="#op-in">operator>></a>(std::basic_istream<CharT, Traits>& is, dynamic_bitset<Block, Allocator>& b);
|
||||
|
||||
} // namespace boost
|
||||
</pre>
|
||||
@@ -488,7 +467,7 @@ None.
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset::reference
|
||||
<a name="reference">dynamic_bitset::reference</a>
|
||||
</pre>
|
||||
A proxy class that acts as a reference to a single bit. It contains
|
||||
an assignment operator, a conversion to <tt>bool</tt>, an
|
||||
@@ -527,23 +506,28 @@ variable <tt>x</tt> is a <tt>bool</tt>.
|
||||
</table>
|
||||
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset::size_type
|
||||
<a name="const_reference">dynamic_bitset::const_reference</a>
|
||||
</pre>
|
||||
The type <tt>bool</tt>.
|
||||
|
||||
<hr>
|
||||
<pre>
|
||||
<a name="size_type">dynamic_bitset::size_type</a>
|
||||
</pre>
|
||||
The unsigned integer for representing the size of the bit set.
|
||||
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset::block_type
|
||||
<a name="block_type">dynamic_bitset::block_type</a>
|
||||
</pre>
|
||||
The same type as the <tt>Block</tt> template parameter.
|
||||
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset::block_size
|
||||
<a name="block_size">dynamic_bitset::block_size</a>
|
||||
</pre>
|
||||
The number of bits in a <tt>Block</tt>.
|
||||
|
||||
@@ -554,7 +538,7 @@ The number of bits in a <tt>Block</tt>.
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset(const Allocator& alloc = Allocator())
|
||||
<a name="cons1">dynamic_bitset</a>(const Allocator& alloc = Allocator())
|
||||
</pre>
|
||||
|
||||
<b>Effects:</b> Constructs a bitset of size zero.
|
||||
@@ -572,7 +556,7 @@ Default Constructible</a>.)
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset(size_type num_bits,
|
||||
<a name="cons2">dynamic_bitset</a>(size_type num_bits,
|
||||
unsigned long value = 0,
|
||||
const Allocator& alloc = Allocator())
|
||||
</pre>
|
||||
@@ -598,7 +582,7 @@ operations such as <tt>resize</tt> to allocate memory.<br>
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset(const dynamic_bitset& x)
|
||||
<a name="cons5">dynamic_bitset</a>(const dynamic_bitset& x)
|
||||
</pre>
|
||||
|
||||
<b>Effects:</b> Constructs a bitset that is a copy of the bitset
|
||||
@@ -619,7 +603,7 @@ Assignable</A>.)
|
||||
<pre>
|
||||
template <typename BlockInputIterator>
|
||||
explicit
|
||||
dynamic_bitset(BlockInputIterator first, BlockInputIterator last,
|
||||
<a name="cons4">dynamic_bitset</a>(BlockInputIterator first, BlockInputIterator last,
|
||||
const Allocator& alloc = Allocator());
|
||||
</pre>
|
||||
|
||||
@@ -645,9 +629,10 @@ Iterator</a> and its <tt>value_type</tt> must be the same type as
|
||||
<pre>
|
||||
template<typename Char, typename Traits, typename Alloc>
|
||||
explicit
|
||||
dynamic_bitset(const <A href="http://www.sgi.com/tech/stl/basic_string.html">std::basic_string</A><Char,Traits,Alloc>& s,
|
||||
size_type pos = 0,
|
||||
size_type n = <A href="http://www.sgi.com/tech/stl/basic_string.html">std::basic_string</A><Char,Traits,Alloc>::npos)
|
||||
<a name="cons3">dynamic_bitset</a>(const <A href="http://www.sgi.com/tech/stl/basic_string.html">std::basic_string</A><Char,Traits,Alloc>& s,
|
||||
typename std::basic_string<CharT, Traits, Alloc>::size_type pos = 0,
|
||||
typename std::basic_string<CharT, Traits, Alloc>::size_type n = <A href="http://www.sgi.com/tech/stl/basic_string.html">std::basic_string</A><Char,Traits,Alloc>::npos,
|
||||
const Allocator& alloc = Allocator())
|
||||
</pre>
|
||||
|
||||
<b>Effects:</b> Constructs a bitset from a string of 0's and 1's. The
|
||||
@@ -683,10 +668,20 @@ and destroys the bitset object itself.<br>
|
||||
|
||||
<h3><a name="member-functions">Member Functions</a></h3>
|
||||
|
||||
<hr>
|
||||
<pre>
|
||||
void <a name="swap">swap</a>(dynamic_bitset& b);
|
||||
</pre>
|
||||
<b>Effects:</b> The contents of this bitset and bitset <tt>b</tt>
|
||||
are exchanged.<br>
|
||||
<b>Postconditions:</b> This bitset is equal to the original <tt>b</tt>,
|
||||
and <tt>b</tt> is equal to the previous version of this bitset.<br>
|
||||
<b>Throws:</b> nothing.
|
||||
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset& operator=(const dynamic_bitset& x)
|
||||
dynamic_bitset& <a name="assign">operator=</a>(const dynamic_bitset& x)
|
||||
</pre>
|
||||
|
||||
<b>Effects:</b> This bitset becomes a copy of the bitset <tt>x</tt>.<br>
|
||||
@@ -706,7 +701,7 @@ dynamic_bitset& operator=(const dynamic_bitset& x)
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
void resize(size_type num_bits, bool value = false);
|
||||
void <a name="resize">resize</a>(size_type num_bits, bool value = false);
|
||||
</pre>
|
||||
|
||||
<b>Effects:</b> Changes the number of bits of the bitset to
|
||||
@@ -726,7 +721,7 @@ discarded).<br>
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
void clear()
|
||||
void <a name="clear">clear</a>()
|
||||
</pre>
|
||||
<b>Effects:</b> The size of the bitset becomes zero.<br>
|
||||
|
||||
@@ -735,7 +730,7 @@ void clear()
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
void push_back(bool value);
|
||||
void <a name="push_back">push_back</a>(bool value);
|
||||
</pre>
|
||||
<b>Effects:</b> Increases the size of the bitset by one, and sets the value of
|
||||
the new most-significant bit to <tt>value</tt>.<br>
|
||||
@@ -746,7 +741,7 @@ the new most-significant bit to <tt>value</tt>.<br>
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
void append(Block value);
|
||||
void <a name="append1">append</a>(Block value);
|
||||
</pre>
|
||||
<b>Effects:</b> Appends the bits in <tt>value</tt> to the bitset
|
||||
(appends to the most-significant end). This increases the size of the
|
||||
@@ -762,7 +757,7 @@ bit at position <tt>(s + i)</tt> is set to <tt>((value >> i) &
|
||||
|
||||
<pre>
|
||||
template <typename BlockInputIterator>
|
||||
void append(BlockInputIterator first, BlockInputIterator last);
|
||||
void <a name="append2">append</a>(BlockInputIterator first, BlockInputIterator last);
|
||||
</pre>
|
||||
<b>Effects:</b> This function provides the same end result as the following
|
||||
code, but is typically more efficient.
|
||||
@@ -782,7 +777,7 @@ Iterator</a> and the <tt>value_type</tt> must be the same type as
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset& operator&=(const dynamic_bitset& rhs)
|
||||
dynamic_bitset& <a name="op-and-assign">operator&=</a>(const dynamic_bitset& rhs)
|
||||
</pre>
|
||||
|
||||
<b>Requires:</b> <tt>this->size() == rhs.size()</tt>.<br>
|
||||
@@ -800,7 +795,7 @@ for (size_type i = 0; i != this->size(); ++i)
|
||||
|
||||
<hr>
|
||||
|
||||
<pre>dynamic_bitset& operator|=(const dynamic_bitset& rhs)
|
||||
<pre>dynamic_bitset& <a name="op-or-assign">operator|=</a>(const dynamic_bitset& rhs)
|
||||
</pre>
|
||||
<b>Requires:</b> <tt>this->size() == rhs.size()</tt>.<br>
|
||||
|
||||
@@ -818,7 +813,7 @@ for (size_type i = 0; i != this->size(); ++i)
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset& operator^=(const dynamic_bitset& rhs)
|
||||
dynamic_bitset& <a name="op-xor-assign">operator^=</a>(const dynamic_bitset& rhs)
|
||||
</pre>
|
||||
<b>Requires:</b> <tt>this->size() == rhs.size()</tt>.<br>
|
||||
|
||||
@@ -836,7 +831,7 @@ for (size_type i = 0; i != this->size(); ++i)
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset& operator-=(const dynamic_bitset& rhs)
|
||||
dynamic_bitset& <a name="op-sub-assign">operator-=</a>(const dynamic_bitset& rhs)
|
||||
</pre>
|
||||
<b>Requires:</b> <tt>this->size() == rhs.size()</tt>.<br>
|
||||
|
||||
@@ -854,7 +849,7 @@ for (size_type i = 0; i != this->size(); ++i)
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset& operator<<=(size_type n)
|
||||
dynamic_bitset& <a name="op-sl-assign">operator<<=</a>(size_type n)
|
||||
</pre>
|
||||
<b>Effects:</b> Shifts the bits in this bitset to the left by
|
||||
<tt>n</tt> bits. For each bit in the bitset, the bit at position pos
|
||||
@@ -868,7 +863,7 @@ or zero if no such bit exists.<br>
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset& operator>>=(size_type n)
|
||||
dynamic_bitset& <a name="op-sr-assign">operator>>=</a>(size_type n)
|
||||
</pre>
|
||||
<b>Effects:</b> Shifts the bits in this bitset to the right by
|
||||
<tt>n</tt> bits. For each bit in the bitset, the bit at position
|
||||
@@ -882,7 +877,7 @@ zero if no such bit exists.<br>
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset operator<<(size_type n) const
|
||||
dynamic_bitset <a name="op-sl">operator<<</a>(size_type n) const
|
||||
</pre>
|
||||
<b>Returns:</b> a copy of <tt>*this</tt> shifted to the left by <tt>n</tt>
|
||||
bits. For each bit in the returned bitset, the bit at position pos
|
||||
@@ -898,7 +893,7 @@ constructing a temporary copy of <tt>b</tt> and then using
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset operator>>(size_type n) const
|
||||
dynamic_bitset <a name="op-sr">operator>></a>(size_type n) const
|
||||
</pre>
|
||||
|
||||
<b>Returns:</b> a copy of <tt>*this</tt> shifted to the right by
|
||||
@@ -915,7 +910,7 @@ temporary copy of <tt>b</tt> and then using
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset& set()
|
||||
dynamic_bitset& <a name="set1">set</a>()
|
||||
</pre>
|
||||
<b>Effects:</b> Sets every bit in this bitset to 1.<br>
|
||||
<b>Returns:</b> <tt>*this</tt><br>
|
||||
@@ -924,7 +919,7 @@ dynamic_bitset& set()
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset& flip()
|
||||
dynamic_bitset& <a name="flip1">flip</a>()
|
||||
</pre>
|
||||
<b>Effects:</b> Flips the value of every bit in this bitset.<br>
|
||||
<b>Returns:</b> <tt>*this</tt><br>
|
||||
@@ -933,7 +928,7 @@ dynamic_bitset& flip()
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset operator~() const
|
||||
dynamic_bitset <a name="op-not">operator~</a>() const
|
||||
</pre>
|
||||
<b>Returns:</b> a copy of <tt>*this</tt> with all of its bits flipped.<br>
|
||||
<b>Throws:</b> An allocation error if memory is exhausted
|
||||
@@ -942,7 +937,7 @@ dynamic_bitset operator~() const
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset& reset()
|
||||
dynamic_bitset& <a name="reset1">reset</a>()
|
||||
</pre>
|
||||
<b>Effects:</b> Clears every bit in this bitset.<br>
|
||||
<b>Returns:</b> <tt>*this</tt><br>
|
||||
@@ -950,7 +945,7 @@ dynamic_bitset& reset()
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset& set(size_type n, bool val = true)
|
||||
dynamic_bitset& <a name="set2">set</a>(size_type n, bool val = true)
|
||||
</pre>
|
||||
|
||||
<b>Effects:</b> Sets bit <tt>n</tt> if <tt>val</tt> is <tt>true</tt>,
|
||||
@@ -965,7 +960,7 @@ this->size()</tt>.
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset& reset(size_type n)
|
||||
dynamic_bitset& <a name="reset2">reset</a>(size_type n)
|
||||
</pre>
|
||||
<b>Effects:</b> Clears bit <tt>n</tt>.<br>
|
||||
<b>Returns:</b> <tt>*this</tt><br>
|
||||
@@ -974,7 +969,7 @@ dynamic_bitset& reset(size_type n)
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset& flip(size_type n)
|
||||
dynamic_bitset& <a name="flip2">flip</a>(size_type n)
|
||||
</pre>
|
||||
<b>Effects:</b> Flips bit <tt>n</tt>.<br>
|
||||
<b>Returns:</b> <tt>*this</tt><br>
|
||||
@@ -983,14 +978,14 @@ dynamic_bitset& flip(size_type n)
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
size_type size() const
|
||||
size_type <a name="size">size</a>() const
|
||||
</pre>
|
||||
<b>Returns:</b> the number of bits in this bitset.<br>
|
||||
<b>Throws:</b> nothing.
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
size_type count() const
|
||||
size_type <a name="count">count</a>() const
|
||||
</pre>
|
||||
<b>Returns:</b> the number of bits in this bitset that are set.<br>
|
||||
<b>Throws:</b> nothing.
|
||||
@@ -998,7 +993,7 @@ size_type count() const
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
bool any() const
|
||||
bool <a name="any">any</a>() const
|
||||
</pre>
|
||||
<b>Returns:</b> <tt>true</tt> if any bits in this bitset are set,
|
||||
and otherwise returns <tt>false</tt>.<br>
|
||||
@@ -1007,7 +1002,7 @@ and otherwise returns <tt>false</tt>.<br>
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
bool none() const
|
||||
bool <a name="none">none</a>() const
|
||||
</pre>
|
||||
<b>Returns:</b> <tt>true</tt> if no bits are set, and otherwise
|
||||
returns <tt>false</tt>.<br>
|
||||
@@ -1016,7 +1011,7 @@ returns <tt>false</tt>.<br>
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
bool test(size_type n) const
|
||||
bool <a name="test">test</a>(size_type n) const
|
||||
</pre>
|
||||
<b>Returns:</b> <tt>true</tt> if bit <tt>n</tt> is set and
|
||||
<tt>false</tt> is bit <tt>n</tt> is 0.<br>
|
||||
@@ -1026,7 +1021,7 @@ bool test(size_type n) const
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
reference operator[](size_type n)
|
||||
reference <a name="bracket">operator[]</a>(size_type n)
|
||||
</pre>
|
||||
</TD>
|
||||
<b>Returns:</b> a <tt>reference</tt> to bit <tt>n</tt>. Note that
|
||||
@@ -1041,7 +1036,7 @@ proxy is not the same as the true reference type <tt>bool&</tt>.<br>
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
bool operator[](size_type n) const
|
||||
bool <a name="const-bracket">operator[]</a>(size_type n) const
|
||||
</pre>
|
||||
<b>Returns:</b> <tt>true</tt> if bit <tt>n</tt> is set. <br>
|
||||
|
||||
@@ -1050,7 +1045,7 @@ bool operator[](size_type n) const
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
unsigned long to_ulong() const
|
||||
unsigned long <a name="to_ulong">to_ulong</a>() const
|
||||
</pre>
|
||||
<b>Returns:</b> An <tt>unsigned long</tt> integer whose bits
|
||||
corresponds to the bits in this bitset, as long as there are no bits
|
||||
@@ -1063,7 +1058,7 @@ can not be represented in an <tt>unsigned long</tt>.
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
bool operator==(const dynamic_bitset& rhs) const
|
||||
bool <a name="op-equal">operator==</a>(const dynamic_bitset& rhs) const
|
||||
</pre>
|
||||
<b>Returns:</b> <tt>true</tt> if <tt>this->size() ==
|
||||
rhs.size()</tt> and if for all <tt>i</tt> in the range
|
||||
@@ -1079,7 +1074,7 @@ returns <tt>false</tt>.<br>
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
bool operator!=(const dynamic_bitset& rhs) const
|
||||
bool <a name="op-not-equal">operator!=</a>(const dynamic_bitset& rhs) const
|
||||
</pre>
|
||||
<b>Returns:</b> <tt>!((*this) == rhs)</tt><br>
|
||||
<b>Throws:</b> nothing.<br>
|
||||
@@ -1090,7 +1085,7 @@ bool operator!=(const dynamic_bitset& rhs) const
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
bool operator<(const dynamic_bitset& rhs) const
|
||||
bool <a name="op-less">operator<</a>(const dynamic_bitset& rhs) const
|
||||
</pre>
|
||||
<b>Returns:</b> <tt>true</tt> if this bitset is lexicographically less
|
||||
than <tt>rhs</tt>, and returns <tt>false</tt> otherwise. (See the
|
||||
@@ -1105,7 +1100,7 @@ ordering). <br>
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
bool operator>(const dynamic_bitset& rhs) const
|
||||
bool <a name="op-greater">operator></a>(const dynamic_bitset& rhs) const
|
||||
</pre>
|
||||
<b>Returns:</b> <tt>!((*this) < rhs || (*this) == rhs)</tt><br>
|
||||
<b>Throws:</b> nothing.<br>
|
||||
@@ -1116,7 +1111,7 @@ Comparable</A>.)
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
bool operator<=(const dynamic_bitset& rhs) const
|
||||
bool <a name="op-less-equal">operator<=</a>(const dynamic_bitset& rhs) const
|
||||
</pre>
|
||||
<b>Returns:</b> <tt>(*this) < rhs || (*this) == rhs</tt><br>
|
||||
<b>Throws:</b> nothing.<br>
|
||||
@@ -1126,7 +1121,7 @@ bool operator<=(const dynamic_bitset& rhs) const
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
bool operator>=(const dynamic_bitset& rhs) const
|
||||
bool <a name="op-greater-equal">operator>=</a>(const dynamic_bitset& rhs) const
|
||||
</pre>
|
||||
<b>Returns:</b> <tt>(*this) > rhs || (*this) == rhs</tt><br>
|
||||
<b>Throws:</b> nothing.<br>
|
||||
@@ -1139,9 +1134,61 @@ bool operator>=(const dynamic_bitset& rhs) const
|
||||
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset <a name="op-and">operator&</a>(const dynamic_bitset& a, const dynamic_bitset& b)
|
||||
</pre>
|
||||
<b>Requires:</b> <tt>a.size() == b.size()</tt><br>
|
||||
<b>Returns:</b> A new bitset that is the bitwise-AND of the bitsets
|
||||
<tt>a</tt> and <tt>b</tt>. Note that the expression <tt>b1 &
|
||||
b2</tt> is equivalent to creating a temporary copy of <tt>b1</tt>,
|
||||
using <tt>operator&=</tt>, and returning the temporary copy.<br>
|
||||
<b>Throws:</b> An allocation error if memory is exhausted
|
||||
(<tt>std::bad_alloc</tt> if <tt>Allocator=std::allocator</tt>).
|
||||
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset <a name="op-or">operator|</a>(const dynamic_bitset& a, const dynamic_bitset& b)
|
||||
</pre>
|
||||
<b>Requires:</b> <tt>a.size() == b.size()</tt><br>
|
||||
<b>Returns:</b> A new bitset that is the bitwise-OR of the bitsets
|
||||
<tt>a</tt> and <tt>b</tt>. Note that the expression <tt>b1 &
|
||||
b2</tt> is equivalent to creating a temporary copy of <tt>b1</tt>,
|
||||
using <tt>operator&=</tt>, and returning the temporary copy.<br>
|
||||
<b>Throws:</b> An allocation error if memory is exhausted
|
||||
(<tt>std::bad_alloc</tt> if <tt>Allocator=std::allocator</tt>).
|
||||
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset <a name="op-xor">operator^</a>(const dynamic_bitset& a, const dynamic_bitset& b)
|
||||
</pre>
|
||||
<b>Requires:</b> <tt>a.size() == b.size()</tt><br>
|
||||
<b>Returns:</b> A new bitset that is the bitwise-XOR of the bitsets
|
||||
<tt>a</tt> and <tt>b</tt>. Note that the expression <tt>b1 &
|
||||
b2</tt> is equivalent to creating a temporary copy of <tt>b1</tt>,
|
||||
using <tt>operator&=</tt>, and returning the temporary copy.<br>
|
||||
<b>Throws:</b> An allocation error if memory is exhausted
|
||||
(<tt>std::bad_alloc</tt> if <tt>Allocator=std::allocator</tt>).
|
||||
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset <a name="op-sub">operator-</a>(const dynamic_bitset& a, const dynamic_bitset& b)
|
||||
</pre>
|
||||
<b>Requires:</b> <tt>a.size() == b.size()</tt><br>
|
||||
<b>Returns:</b> A new bitset that is the set difference of the bitsets
|
||||
<tt>a</tt> and <tt>b</tt>. Note that the expression <tt>b1 - b2</tt>
|
||||
is equivalent to creating a temporary copy of <tt>b1</tt>,
|
||||
using <tt>operator-=</tt>, and returning the temporary copy.<br>
|
||||
<b>Throws:</b> An allocation error if memory is exhausted
|
||||
(<tt>std::bad_alloc</tt> if <tt>Allocator=std::allocator</tt>).
|
||||
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
template <typename CharT, typename Alloc>
|
||||
void to_string(const dynamic_bitset<Block, Allocator>& b,
|
||||
void <a name="to_string">to_string</a>(const dynamic_bitset<Block, Allocator>& b,
|
||||
<A href="http://www.sgi.com/tech/stl/basic_string.html">std::basic_string</A><Char,Traits,Alloc>& s)
|
||||
</pre>
|
||||
|
||||
@@ -1165,63 +1212,30 @@ position <tt>i</tt> in the string corresponds to bit position
|
||||
properly.
|
||||
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset operator&(const dynamic_bitset& a, const dynamic_bitset& b)
|
||||
template <typename Char, typename Traits, typename Block, typename Alloc>
|
||||
basic_ostream<Char, Traits>&
|
||||
<a name="op-out">operator<<</a>(basic_ostream<Char, Traits>& os, const dynamic_bitset<Block, Alloc>& x)
|
||||
</pre>
|
||||
Output a <tt>dynamic_bitset</tt> to an output stream. This function
|
||||
behaves as if it converts the <tt>dynamic_bitset</tt> to a string and then
|
||||
writes that string to the output stream. That is, it is equivalent to
|
||||
<pre>
|
||||
std::basic_string<Char, Traits> s;
|
||||
to_string(x, s):
|
||||
os << s;
|
||||
</pre>
|
||||
<b>Requires:</b> <tt>a.size() == b.size()</tt><br>
|
||||
<b>Returns:</b> A new bitset that is the bitwise-AND of the bitsets
|
||||
<tt>a</tt> and <tt>b</tt>. Note that the expression <tt>b1 &
|
||||
b2</tt> is equivalent to creating a temporary copy of <tt>b1</tt>,
|
||||
using <tt>operator&=</tt>, and returning the temporary copy.<br>
|
||||
<b>Throws:</b> An allocation error if memory is exhausted
|
||||
(<tt>std::bad_alloc</tt> if <tt>Allocator=std::allocator</tt>).
|
||||
|
||||
Also will throw <tt>std::ios_base::failure</tt> if there is a problem
|
||||
writing to the stream.
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset operator|(const dynamic_bitset& a, const dynamic_bitset& b)
|
||||
</pre>
|
||||
<b>Requires:</b> <tt>a.size() == b.size()</tt><br>
|
||||
<b>Returns:</b> A new bitset that is the bitwise-OR of the bitsets
|
||||
<tt>a</tt> and <tt>b</tt>. Note that the expression <tt>b1 &
|
||||
b2</tt> is equivalent to creating a temporary copy of <tt>b1</tt>,
|
||||
using <tt>operator&=</tt>, and returning the temporary copy.<br>
|
||||
<b>Throws:</b> An allocation error if memory is exhausted
|
||||
(<tt>std::bad_alloc</tt> if <tt>Allocator=std::allocator</tt>).
|
||||
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset operator^(const dynamic_bitset& a, const dynamic_bitset& b)
|
||||
</pre>
|
||||
<b>Requires:</b> <tt>a.size() == b.size()</tt><br>
|
||||
<b>Returns:</b> A new bitset that is the bitwise-XOR of the bitsets
|
||||
<tt>a</tt> and <tt>b</tt>. Note that the expression <tt>b1 &
|
||||
b2</tt> is equivalent to creating a temporary copy of <tt>b1</tt>,
|
||||
using <tt>operator&=</tt>, and returning the temporary copy.<br>
|
||||
<b>Throws:</b> An allocation error if memory is exhausted
|
||||
(<tt>std::bad_alloc</tt> if <tt>Allocator=std::allocator</tt>).
|
||||
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
dynamic_bitset operator-(const dynamic_bitset& a, const dynamic_bitset& b)
|
||||
</pre>
|
||||
<b>Requires:</b> <tt>a.size() == b.size()</tt><br>
|
||||
<b>Returns:</b> A new bitset that is the set difference of the bitsets
|
||||
<tt>a</tt> and <tt>b</tt>. Note that the expression <tt>b1 - b2</tt>
|
||||
is equivalent to creating a temporary copy of <tt>b1</tt>,
|
||||
using <tt>operator-=</tt>, and returning the temporary copy.<br>
|
||||
<b>Throws:</b> An allocation error if memory is exhausted
|
||||
(<tt>std::bad_alloc</tt> if <tt>Allocator=std::allocator</tt>).
|
||||
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
template <typename Char, typename Traits, typename Block, typename Alloc>
|
||||
basic_istream<Char,Traits>&
|
||||
operator>>(basic_istream<Char,Traits>& is, dynamic_bitset<Block, Alloc>& x)
|
||||
<a name="op-in">operator>></a>(basic_istream<Char,Traits>& is, dynamic_bitset<Block, Alloc>& x)
|
||||
</pre>
|
||||
<b>Effects:</b> Extracts a <tt>dynamic_bitset</tt> from an input
|
||||
stream. This function first skips whitespace, then extracts up to
|
||||
@@ -1241,25 +1255,6 @@ input stream will be <tt>a</tt>.<br>
|
||||
reading from the stream.
|
||||
|
||||
<hr>
|
||||
<pre>
|
||||
template <typename Char, typename Traits, typename Block, typename Alloc>
|
||||
basic_ostream<Char, Traits>&
|
||||
operator<<(basic_ostream<Char, Traits>& os, const dynamic_bitset<Block, Alloc>& x)
|
||||
</pre>
|
||||
Output a <tt>dynamic_bitset</tt> to an output stream. This function
|
||||
behaves as if it converts the <tt>dynamic_bitset</tt> to a string and then
|
||||
writes that string to the output stream. That is, it is equivalent to
|
||||
<pre>
|
||||
std::basic_string<Char, Traits> s;
|
||||
to_string(x, s):
|
||||
os << s;
|
||||
</pre>
|
||||
<b>Throws:</b> An allocation error if memory is exhausted
|
||||
(<tt>std::bad_alloc</tt> if <tt>Allocator=std::allocator</tt>).
|
||||
Also will throw <tt>std::ios_base::failure</tt> if there is a problem
|
||||
writing to the stream.
|
||||
<hr>
|
||||
|
||||
|
||||
<h3><a name="see-also">See also</a></h3>
|
||||
<tt><A href="http://www.sgi.com/tech/stl/bitset.html">std::bitset</A></tt>,
|
||||
|
||||
Reference in New Issue
Block a user