operator&,|,^(std::bitset)
De cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
<tbody> </tbody> 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) | |
Effectue binaire AND, OR, XOR et entre deux bitsets,
lhs et 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.
1)
Retourne une
bitset<N> contenant le résultat de ET binaire sur des paires correspondantes de bits de lhs et 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.
2)
Retourne une
bitset<N> contenant le résultat de OU binaire sur des paires correspondantes de bits de lhs et 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.
3)
Retourne un
bitset<N> contenant le résultat de OU exclusif binaire sur des paires correspondantes de bits de lhs et 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.
Paramètres
| lhs | - | la bitset sur le côté gauche de l'opérateur
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 | - | l'bitset sur le côté droit de l'opérateur
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. |
Retourne la valeur
1)
{{{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.
2)
{{{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.
3)
{{{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.
Exceptions
Exemple
#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';
}
Résultat :
b1 & b2: 0010
b1 | b2: 0111
b1 ^ b2: 0101
Voir aussi
effectue binaire AND, OR, XOR et 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. (fonction membre publique) | |