operator&,|,^(std::bitset)
Da cppreference.com.
![]() | Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate. La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
bitset<N> operator&(const bitset<N>& lhs, const bitset<N>& rhs ); | (1) | |
bitset<N> operator|(const bitset<N>& lhs, const bitset<N>& rhs ); | (2) | |
bitset<N> operator^(const bitset<N>& lhs, const bitset<N>& rhs ); | (3) | |
Esegue binaria AND, OR e XOR tra due bitset,
1) lhs
e rhs
.Original:
Performs binary AND, OR, and XOR between two bitsets,
lhs
and rhs
.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Restituisce un
2) bitset<N>
contenente il risultato di AND binario su corrispondenti coppie di bit di lhs
e rhs
.Original:
Returns a
bitset<N>
containing the result of binary AND on corresponding pairs of bits of lhs
and rhs
.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Restituisce un
3) bitset<N>
contenente il risultato binario OR il corrispondenti coppie di bit di lhs
e rhs
.Original:
Returns a
bitset<N>
containing the result of binary OR on corresponding pairs of bits of lhs
and rhs
.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Restituisce un
bitset<N>
contenente il risultato di XOR binario su corrispondenti coppie di bit di lhs
e rhs
.Original:
Returns a
bitset<N>
containing the result of binary XOR on corresponding pairs of bits of lhs
and rhs
.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Indice |
[modifica]Parametri
lhs | - | il bitset sulla sinistra dell'operatore Original: the bitset on the left-hand side of the operator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
rhs | - | il bitset sulla destra dell'operatore Original: the bitset on the right-hand side of the operator 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){{{1}}}
2) Original:
{{{2}}}
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
{{{1}}}
3) Original:
{{{2}}}
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
{{{1}}}
Original:
{{{2}}}
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[modifica]Eccezioni
[modifica]Esempio
#include <bitset>#include <iostream> int main(){std::bitset<4> b1("0110");std::bitset<4> b2("0011");std::cout<<"b1 & b2: "<<(b1 & b2)<<'\n';std::cout<<"b1 | b2: "<<(b1 | b2)<<'\n';std::cout<<"b1 ^ b2: "<<(b1 ^ b2)<<'\n';}
Output:
b1 & b2: 0010 b1 | b2: 0111 b1 ^ b2: 0101
[modifica]Vedi anche
esegue binaria AND, OR, XOR e NOT Original: performs binary AND, OR, XOR and NOT The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (metodo pubblico) |