operator==,!=(std::bitset)

Da cppreference.com.
< cpp‎ | utility‎ | bitset

 
 
Utilità libreria
Tipo di supporto (basic types, RTTI, type traits)
Gestione della memoria dinamica
La gestione degli errori
Programma di utilità
Funzioni variadic
Data e ora
Funzione oggetti
initializer_list(C++11)
bitset
hash(C++11)
Gli operatori relazionali
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
Coppie e tuple
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pair
tuple(C++11)
piecewise_construct_t(C++11)
piecewise_construct(C++11)
Swap, in avanti e spostare
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
swap
forward(C++11)
move(C++11)
move_if_noexcept(C++11)
declval(C++11)
 
std::bitset
Membri tipi
Original:
Member types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::reference
Membri funzioni
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::bitset
bitset::operator==
bitset::operator!=
Elemento accesso
Original:
Element access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::operator[]
bitset::test
bitset::all
bitset::any
bitset::none
(C++11)

 
bitset::count
Capacità
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::size
Modificatori
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::operator&=
bitset::operator|=
bitset::operator^=
bitset::operator~
bitset::operator<<=
bitset::operator>>=
bitset::operator<<
bitset::operator>>
bitset::set
bitset::reset
bitset::flip
Conversioni
Original:
Conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::to_string
bitset::to_ulong
bitset::to_ullong(C++11)
Non membri funzioni
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
operator&
operator|
operator^
operator<<
operator>>
Helper classi
Original:
Helper classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std::hash(C++11)
 
bool operator==(const bitset<N>& rhs );
(1)
bool operator!=(const bitset<N>& rhs );
(2)
1)
Restituisce true se tutti i bit in *this e rhs sono uguali.
Original:
Returns true if all of the bits in *this and rhs are equal.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
Restituisce true se uno dei bit in *this e rhs non sono uguali.
Original:
Returns true if any of the bits in *this and rhs are not equal.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifica]Parametri

rhs -
bitset da confrontare
Original:
bitset to compare
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifica]Valore di ritorno

1)
true se il valore di ogni bit in *this uguale al valore del bit corrispondente rhs, altrimenti false
Original:
true if the value of each bit in *this equals the value of the corresponding bit in rhs, otherwise false
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
true se , altrimenti false
Original:
true if , otherwise false
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifica]Esempio

Confronta due bitset per determinare se sono identici:
Original:
Compare two bitsets to determine if they are identical:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

#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
close