std::bitset::all, std::bitset::any, std::bitset::none
Da cppreference.com.
|
|
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
<metanoindex/>
<tbody> </tbody> bool all() const; |
(dal C++11) | |
bool any() const; |
||
bool none() const; |
||
Verifica se tutti, alcuni o nessuno dei bit sono impostati a
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.
You can help to correct and verify the translation. Click here for instructions.
1)
Verifica se tutti i bit sono impostati su
trueOriginal:
Checks if all bits are set to
trueThe 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)
Verifica se i bit sono impostati su
trueOriginal:
Checks if any bits are set to
trueThe 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)
Controlla se nessuno dei bit sono impostati a
trueOriginal:
Checks if none of the bits are set to
trueThe 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.
Parametri
(Nessuno)
Original:
(none)
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.
Valore di ritorno
1)
true se tutti i bit sono impostati su true, altrimenti falseOriginal:
true if all bits are set to true, otherwise falseThe 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)
true se uno dei bit sono impostati su true, altrimenti falseOriginal:
true if any of the bits are set to true, otherwise falseThe 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)
true se nessuno dei bit sono impostati su true, altrimenti falseOriginal:
true if none of the bits are set to true, otherwise falseThe 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.
Esempio
#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