std::bitset::operator&=,|=,^=,~
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>& other ); | (1) | |
bitset<N>& operator|=(const bitset<N>& other ); | (2) | |
bitset<N>& operator^=(const bitset<N>& other ); | (3) | |
bitset<N> operator~()const; | (4) | |
Esegue binaria AND, OR, XOR e NOT.
1) 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.
You can help to correct and verify the translation. Click here for instructions.
Consente di impostare i bit per il risultato di binario e su corrispondenti coppie di bit di *this e
2) other
.Original:
Sets the bits to the result of binary AND on corresponding pairs of bits of *this and
other
.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.
Consente di impostare i bit per il risultato di binario o su corrispondenti coppie di bit di *this e
3) other
.Original:
Sets the bits to the result of binary OR on corresponding pairs of bits of *this and
other
.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.
Imposta i bit al risultato XOR binaria su corrispondenti coppie di bit di *this e
4) other
.Original:
Sets the bits to the result of binary XOR on corresponding pairs of bits of *this and
other
.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 una copia temporanea di *this con tutti i bit capovolte (binario NOT).
Original:
Returns a temporary copy of *this with all bits flipped (binary NOT).
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.
Indice |
[modifica]Parametri
other | - | un altro bitset Original: another bitset 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-3) *this
4)un <N> bitset temporanea con tutti i bit capovolto
Original:
a bitset<N> temporary with all bits flipped
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]Esempio
#include <iostream>#include <string>#include <bitset> int main(){std::bitset<16> dest;std::string pattern_str ="1001";std::bitset<16> pattern(pattern_str); for(size_t i =0, ie = dest.size()/pattern_str.size(); i != ie;++i){ dest <<= pattern_str.size(); dest |= pattern;}std::cout<< dest <<'\n';}
Output:
1001100110011001
[modifica]Vedi anche
esegue spostamento a sinistra binario e spostamento a destra Original: performs binary shift left and shift right The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (metodo pubblico) |