Espaços nominais
Variantes
Acções

std::bitset::all, std::bitset::any, std::bitset::none

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
initializer_list(C++11)
bitset
hash(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.
pair
tuple(C++11)
piecewise_construct_t(C++11)
piecewise_construct(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.
swap
forward(C++11)
move(C++11)
move_if_noexcept(C++11)
declval(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.
operator&
operator|
operator^
operator<<
operator>>
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.
std::hash(C++11)
 
bool all() const;
(a partir do C++ 11)
bool any() const;
bool none() const;
Verifica se todos, alguns ou nenhum dos bits são definidos como true.
Original:
Checks if all, any or none of the bits are set to true.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
Verifica se todos os bits são definidos como true
Original:
Checks if all bits are set to true
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
Verifica se os bits são definidos para true
Original:
Checks if any bits are set to true
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)
Verifica se nenhum dos bits são definidos como true
Original:
Checks if none of the bits are set to true
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

(Nenhum)
Original:
(none)
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 todos os bits são definidos para true, caso contrário false
Original:
true if all bits are set to true, 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 qualquer um dos bits são definidos como true, caso contrário false
Original:
true if any of the bits are set to true, otherwise false
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)
true se nenhum dos bits são definidos como true, caso contrário false
Original:
true if none of the bits are set to true, 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

#include <iostream>
#include <bitset>
 
int main()
{
    std::bitset<4> b1("0000");
    std::bitset<4> b2("0101");
    std::bitset<4> b3("1111");
 
    std::cout << "bitset\t" << "all\t" << "any\t" << "none\n";
    std::cout << b1 << '\t' << b1.all() << '\t' << b1.any() << '\t' << b1.none() << '\n';
    std::cout << b2 << '\t' << b2.all() << '\t' << b2.any() << '\t' << b2.none() << '\n';
    std::cout << b3 << '\t' << b3.all() << '\t' << b3.any() << '\t' << b3.none() << '\n';
}

Output:

bitset  all     any     none
0000    0       0       1
0101    0       1       0
1111    1       1       0