operator==,!=(std::bitset) (3) - Linux Manuals
operator==,!=(std::bitset): operator==,!=(std::bitset)
Command to display operator==,!=(std::bitset)
manual in Linux: $ man 3 operator==,!=(std::bitset)
NAME
operator==,!=(std::bitset) - operator==,!=(std::bitset)
Synopsis
bool operator==( const bitset<N>& rhs ) const; (1)
bool operator!=( const bitset<N>& rhs ) const; (2)
1) Returns true if all of the bits in *this and rhs are equal.
2) Returns true if any of the bits in *this and rhs are not equal.
Parameters
rhs - bitset to compare
Return value
1) true if the value of each bit in *this equals the value of the corresponding bit in rhs, otherwise false
2) true if !(*this == rhs), otherwise false
Example
Compare two bitsets to determine if they are identical:
// Run this code
#include <iostream>
#include <bitset>
int main()
{
std::bitset<4> b1(3); // [0,0,1,1]
std::bitset<4> b2(b1);
std::bitset<4> b3(4); // [0,1,0,0]
std::cout << "b1 == b2: " << (b1 == b2) << '\n';
std::cout << "b1 == b3: " << (b1 == b3) << '\n';
std::cout << "b1 != b3: " << (b1 != b3) << '\n';
}
Output:
b1 == b2: 1
b1 == b3: 0
b1 != b3: 1
Pages related to operator==,!=(std::bitset)
- operator==,!=(std::binomial_distribution) (3) - operator==,!=(std::binomial_distribution)
- operator==,!=(std::bernoulli_distribution) (3) - operator==,!=(std::bernoulli_distribution)
- operator==,!=(std::allocator) (3) - operator==,!=(std::allocator)
- operator==,!=(std::cauchy_distribution) (3) - operator==,!=(std::cauchy_distribution)
- operator==,!=(std::chi_squared_distribution) (3) - operator==,!=(std::chi_squared_distribution)
- operator==,!=(std::complex) (3) - operator==,!=(std::complex)
- operator==,!=(std::discard_block_engine) (3) - operator==,!=(std::discard_block_engine)
- operator==,!=(std::discrete_distribution) (3) - operator==,!=(std::discrete_distribution)
- operator==,!=(std::experimental::function) (3) - operator==,!=(std::experimental::function)
- operator==,!=(std::experimental::pmr::polymorphic_allocator) (3) - operator==,!=(std::experimental::pmr::polymorphic_allocator)
- operator==,!=(std::exponential_distribution) (3) - operator==,!=(std::exponential_distribution)
- operator==,!=(std::extreme_value_distribution) (3) - operator==,!=(std::extreme_value_distribution)
- operator==,!=(std::fisher_f_distribution) (3) - operator==,!=(std::fisher_f_distribution)
- operator==,!=(std::function) (3) - operator==,!=(std::function)
- operator==,!=(std::gamma_distribution) (3) - operator==,!=(std::gamma_distribution)
- operator==,!=(std::geometric_distribution) (3) - operator==,!=(std::geometric_distribution)
- operator==,!=(std::independent_bits_engine) (3) - operator==,!=(std::independent_bits_engine)
- operator==,!=(std::istream_iterator) (3) - operator==,!=(std::istream_iterator)
- operator==,!=(std::istreambuf_iterator) (3) - operator==,!=(std::istreambuf_iterator)
- operator==,!=(std::linear_congruential_engine) (3) - operator==,!=(std::linear_congruential_engine)
- operator==,!=(std::lognormal_distribution) (3) - operator==,!=(std::lognormal_distribution)
- operator==,!=(std::match_results) (3) - operator==,!=(std::match_results)
- operator==,!=(std::mersenne_twister_engine) (3) - operator==,!=(std::mersenne_twister_engine)