<div class="t-tr-text">C + +: concetti<div class="t-tr-dropdown"><div><div><div class="t-tr-dropdown-arrow-border"></div><div class="t-tr-dropdown-arrow"></div><div class="t-tr-dropdown-h">Original:</div><div class="t-tr-dropdown-orig">C++ concepts:</div><div class="t-tr-dropdown-notes">The text has been machine-translated via [http://translate.google.com Google Translate].<br/> You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.</div></div></div></div></div> BitmaskType
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. |
Definisce un tipo che può essere utilizzato per rappresentare un insieme di valori costanti o qualsiasi combinazione di questi valori. Questa caratteristica viene in genere implementata da tipi interi, std::bitset o enumerazioni (ambito e senza ambito) con sovraccarichi di comando supplementari.
Original:
Defines a type that can be used to represent a set of constant values or any combination of those values. This trait is typically implemented by integer types, std::bitset, or enumerations (scoped and unscoped) with additional operator overloads.
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.
[modifica]Requisiti
Il tipo di maschera di bit supporta un numero finito di elementi maschera di bit, che sono valori distinti di tipo maschera di bit, in modo tale che, per ogni coppia Ci e Cj, Ci & Ci !=0 e Ci & Cj ==0.
Original:
The bitmask type supports a finite number of bitmask elements, which are distinct values of the bitmask type, such that, for any pair Ci and Cj, Ci & Ci !=0 and Ci & Cj ==0.
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.
Gli operatori bit a bit operator&, operator|, operator^, operator~, operator&=, operator|= e operator^= sono definite per valori del tipo di maschera di bit e hanno la stessa semantica dei corrispondenti operatori built-in su numeri interi senza segno avrebbe se gli elementi di maschera di bit sono stati l'intero distinti potenze di due.
Original:
The bitwise operators operator&, operator|, operator^, operator~, operator&=, operator|=, and operator^= are defined for values of the bitmask type and have the same semantics as the corresponding built-in operators on unsigned integers would have if the bitmask elements were the distinct integer powers of two.
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.
Le seguenti espressioni sono ben formati e hanno il seguente significato per ogni X. BitsetType
Original:
The following expressions are well-formed and have the following meaning for any BitsetType X
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.
X |= Y | imposta il valore Y nella X. oggetto Original: sets the value Y in the object X The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
X &= ~Y | cancella il valore Y nella X. oggetto Original: clears the value Y in the object X The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
X&Y !=0 | Y indica che il valore è impostato nel X. oggetto Original: indicates that the value Y is set in the object X The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Ogni elemento bitmask representible è definito come un valore constexpr del tipo bitmask.
Original:
Each representible bitmask element is defined as a constexpr value of the bitmask type.
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.
[modifica]Utilizzo
I seguenti tipi di libreria standard soddisfare
BitmaskType
:Original:
The following standard library types satisfy
BitmaskType
: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.
- std::ctype_base::mask
- std::ios_base::fmtflags
- std::ios_base::iostate
- std::ios_base::openmode
- std::regex_traits::char_class_type
- std::regex_constants::syntax_option_type
- std::regex_constants::match_flag_type
- std::launch,
Il codice che si basa su qualche opzione particolare implementazione (ad esempio int n =std::ios_base::hex), è portabile perché std::ios_base::fmtflags non è necessariamente convertibile in modo implicito int.
Original:
Code that relies on some particular implementation option (e.g. int n =std::ios_base::hex), is nonportable because std::ios_base::fmtflags is not necessarily implicitly convertible to int.
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.