boost::dynamic_bitset::reference
A proxy class to simulate lvalues of bit type.
Synopsis
Declared in <boost/dynamic_bitset/dynamic_bitset.hpp>
class reference;
Member Functions
Name |
Description |
|
Copy constructor. |
See the class description. |
|
See the class description. |
|
|
Deleted address‐of operator. |
See the class description. |
|
See the class description. |
|
See the class description. |
|
See the class description. |
|
See the class description. |
|
See the class description. |
Friends
| Name | Description |
|---|---|
|
|
The |
Description
This class exists only as a helper class for dynamic_bitset's operator[]. The following list describes the valid operations on the reference type. Assume that b is an instance of dynamic_bitset, i, j are of size_type and in the range [0, b.size()). Also, note that when we write b[ i ] we mean an object of type reference that was initialized from b[ i ]. The variable x is a bool.
‐ (bool)b[ i ]
Returns the i‐th bit of b.
‐ (bool)~ b[ i ]
Returns the opposite of the i‐th bit of b.
‐ b[ i ].flip()
Flips the i‐th bit of b and returns b[ i ].
‐ x = b[ i ]
Assigns the i‐th bit of b to x.
‐ b[ i ] = x
Sets the i‐th bit of b to the value of x and returns b[ i ].
‐ b[ i ] = b[ j ]
Sets the i‐th bit of b to the value of the j‐th bit of b and returns b[ i ].
‐ b[ i ] |= x
Does an OR of the i‐th bit of b with the value of x and returns b[ i ].
‐ b[ i ] &= x
Does an AND of the i‐th bit of b with the value of x and returns b[ i ].
‐ b[ i ] ˆ= x
Does a XOR of the i‐th bit of b with the value of x and returns b[ i ].
‐ b[ i ] ‐= x
If x is true, clears the i‐th bit of b. Returns b[ i ].
‐ b[ i ] |= b[ j ]
Does an OR of the i‐th bit of b with the j‐th bit of b and returns b[ i ].
‐ b[ i ] &= b[ j ]
Does an AND of the i‐th bit of b with the j‐th bit of b and returns b[ i ].
‐ b[ i ] ˆ= b[ j ]
Does a XOR of the i‐th bit of b with the j‐th bit of b and returns b[ i ].
‐ b[ i ] ‐= b[ j ]
If the j‐th bit of b is set, clears the i‐th bit of b. Returns b[ i ].
Created with MrDocs