|
template<typename integral_type , typename = std::enable_if_t<std::is_integral_v<integral_type>>> |
| dynamic_bitset (integral_type) -> dynamic_bitset<> |
|
template<typename Block , typename Allocator > |
constexpr bool | operator!= (const dynamic_bitset< Block, Allocator > &lhs, const dynamic_bitset< Block, Allocator > &rhs) |
| Test if two sul::dynamic_bitset content are different.
|
|
template<typename Block , typename Allocator > |
constexpr bool | operator<= (const dynamic_bitset< Block, Allocator > &lhs, const dynamic_bitset< Block, Allocator > &rhs) |
| Test if lhs is "less than or equal to" rhs . The comparison of the two sul::dynamic_bitset is first on numbers their content represent and then on their size.
|
|
template<typename Block , typename Allocator > |
constexpr bool | operator> (const dynamic_bitset< Block, Allocator > &lhs, const dynamic_bitset< Block, Allocator > &rhs) |
| Test if lhs is "greater than" rhs . The comparison of the two sul::dynamic_bitset is first on numbers their content represent and then on their size.
|
|
template<typename Block , typename Allocator > |
constexpr bool | operator>= (const dynamic_bitset< Block, Allocator > &lhs, const dynamic_bitset< Block, Allocator > &rhs) |
| Test if lhs is "greater than or equal to" rhs . The comparison of the two sul::dynamic_bitset is first on numbers their content represent and then on their size.
|
|
template<typename Block , typename Allocator > |
constexpr dynamic_bitset< Block, Allocator > | operator& (const dynamic_bitset< Block, Allocator > &lhs, const dynamic_bitset< Block, Allocator > &rhs) |
| Performs binary AND on corresponding pairs of bits of lhs and rhs .
|
|
template<typename Block , typename Allocator > |
constexpr dynamic_bitset< Block, Allocator > | operator| (const dynamic_bitset< Block, Allocator > &lhs, const dynamic_bitset< Block, Allocator > &rhs) |
| Performs binary OR on corresponding pairs of bits of lhs and rhs .
|
|
template<typename Block , typename Allocator > |
constexpr dynamic_bitset< Block, Allocator > | operator^ (const dynamic_bitset< Block, Allocator > &lhs, const dynamic_bitset< Block, Allocator > &rhs) |
| Performs binary XOR on corresponding pairs of bits of lhs and rhs .
|
|
template<typename Block , typename Allocator > |
constexpr dynamic_bitset< Block, Allocator > | operator- (const dynamic_bitset< Block, Allocator > &lhs, const dynamic_bitset< Block, Allocator > &rhs) |
| Performs binary difference between bits of lhs and rhs .
|
|
template<typename _CharT , typename _Traits , typename Block , typename Allocator > |
constexpr std::basic_ostream< _CharT, _Traits > & | operator<< (std::basic_ostream< _CharT, _Traits > &os, const dynamic_bitset< Block, Allocator > &bitset) |
| Insert a string representation of this sul::dynamic_bitset to a character stream.
|
|
template<typename _CharT , typename _Traits , typename Block , typename Allocator > |
constexpr std::basic_istream< _CharT, _Traits > & | operator>> (std::basic_istream< _CharT, _Traits > &is, dynamic_bitset< Block, Allocator > &bitset) |
| Extract a sul::dynamic_bitset from a character stream using its string representation.
|
|
template<typename Block , typename Allocator > |
constexpr void | swap (dynamic_bitset< Block, Allocator > &bitset1, dynamic_bitset< Block, Allocator > &bitset2) |
| Exchange the content of bitset1 and bitset2 .
|
|
template<typename Block_ , typename Allocator_ > |
constexpr bool | operator== (const dynamic_bitset< Block_, Allocator_ > &lhs, const dynamic_bitset< Block_, Allocator_ > &rhs) |
|
template<typename Block_ , typename Allocator_ > |
constexpr bool | operator< (const dynamic_bitset< Block_, Allocator_ > &lhs, const dynamic_bitset< Block_, Allocator_ > &rhs) |
|
The size comparison is necessary for the comparison operators to keep their properties. For example without the size comparison the "<=" operator (defined for "A <= B" by "!(B < A)") would no longer be antisymmetric (if A <= B and B <= A, then A == B) because operator==() compare the sul::dynamic_bitset as a container and not a number. For example with bitsets A(0011) and B(011), without the size comparison B < A would be false, A <= B would be true, B <= A would be true, but A == B would be false, breaking the antisymmetric property of the operator. Thus, to respect the properties of the operators, the size is used as a secondary criteria for the comparison of sul::dynamic_bitset which content represent the same number. Therefore, for the previous example with bitsets A(0011) and B(011), B < A is true, A <= B is false, B <= A is true and A == B is false.
If comparing bitsets A and B with the content of A representing the number a, and the content of B representing the number b, this operator would work as follow:
{
}
else
{
return a < b;
}
- Parameters
-
- Template Parameters
-
Block_ | Block type used by lhs and rhs for storing the bits |
Allocator_ | Allocator type used by lhs and rhs for memory management |
- Returns
- true if
lhs
is "less than" rhs
- Complexity
- Linear in the size of the sul::dynamic_bitset.
- Since
- 1.0.0