Espaços nominais
Variantes
Acções

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

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

 
 
Biblioteca de utilitários
Digite apoio (basic types, RTTI, type traits)
Gerenciamento de memória dinâmica
De tratamento de erros
Utilidades do programa
Variadic funções
Data e hora
Objetos de função
(C++11)
Os operadores relacionais
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
Pares e tuplas
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
Troque, avançar e avançar
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
(C++11)
(C++11)
 
std::bitset
Tipos de membro
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
Funções de membro
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!=
acesso. Elemento
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
Capacidade
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
Modificadores
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
Conversões
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)
Não-membros funções
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.
Classes auxiliares
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.
(C++11)
 
bool operator==( const bitset<N>& rhs );
(1)
bool operator!=( const bitset<N>& rhs );
(2)
1)
Retorna true se todos os bits em *this e rhs são iguais.
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)
Retorna true se qualquer um dos bits em *this e rhs não são iguais.
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.

[editar] Parâmetros

rhs -
bitset para comparar
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.

[editar] Valor de retorno

1)
true se o valor de cada bit na *this é igual ao valor do bit correspondente na rhs, caso contrário 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 se, de outro modo 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.

[editar] Exemplo

Comparar dois bitsets para determinar se eles são idênticos:
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';
}

Saída:

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