Espaces de noms
Variantes
Affichages
Actions

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

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

 
 
 
std::bitset
Types de membres
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
Les fonctions membres
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!=
Elément d'accès
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
Modificateurs
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
Conversions
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)
Tiers fonctions
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>>
Classes d'aide
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)
Renvoie true si tous les bits dans *this et rhs sont égaux .
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)
Renvoie true si l'un des bits dans *this et rhs ne sont pas égaux .
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.

[modifier] Paramètres

rhs -
BitSet à comparer
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.

[modifier] Retourne la valeur

1)
true si la valeur de chaque bit dans *this égale à la valeur du bit correspondant dans rhs, autrement 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 si , sinon 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.

[modifier] Exemple

Comparer deux bitsets afin de déterminer s'ils sont identiques:
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';
}

Résultat :

b1 == b2: 1
b1 == b3: 0
b1 != b3: 1