operator&,|,^(std::bitset)
De cppreference.com
![]() |
Esta página se ha traducido por ordenador/computador/computadora de la versión en inglés de la Wiki usando Google Translate.
La traducción puede contener errores y palabras aparatosas/incorrectas. Planea sobre el texto para ver la versión original. Puedes ayudar a corregir los errores y mejorar la traducción. Para instrucciones haz clic aquí. |
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) | |
Realiza binario AND, OR, y XOR entre dos bitsets,
1) lhs
y 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.
Devuelve una
2) bitset<N>
que contiene el resultado de binarios y en los correspondientes pares de bits de lhs
y 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.
Devuelve una
3) bitset<N>
que contiene el resultado de binario OR en pares correspondientes de bits de lhs
y 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.
Devuelve una
bitset<N>
que contiene el resultado de la operación XOR binaria en los correspondientes pares de bits de lhs
y 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.
Contenido |
[editar] Parámetros
lhs | - | la bitset en el lado izquierdo del operador
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 | - | la bitset en el lado derecho del operador
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. |
[editar] Valor de retorno
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.
[editar] Excepciones
[editar] Ejemplo
Ejecuta este código
#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'; }
Salida:
b1 & b2: 0010 b1 | b2: 0111 b1 ^ b2: 0101
[editar] Ver también
realiza operación binaria AND, OR, XOR y NOT (función miembro pública) |