Conceptos C++: BitmaskType
De cppreference.com
![]() |
Esta página se ha traducido por ordenador/computador/computadora de la versión en inglés de la Wiki usando Google Translate.
La traducción puede contener errores y palabras aparatosas/incorrectas. Planea sobre el texto para ver la versión original. Puedes ayudar a corregir los errores y mejorar la traducción. Para instrucciones haz clic aquí. |
Define un tipo que se puede utilizar para representar un conjunto de valores constantes o cualquier combinación de estos valores. Este rasgo es típicamente implementado por los tipos enteros, std::bitset o enumeraciones (ámbito y sin ámbito) con sobrecargas de operadores adicionales .
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.
[editar] Requisitos
El tipo de máscara de bits compatible con un número finito de elementos de máscara de bits, que son valores diferentes de la máscara de bits de tipo, de tal manera que, para cualquier par Ci y Cj, Ci & Ci != 0 y 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.
Los operadores bit a bit operator&, operator|, operator^, operator~, operator&=, operator|= y operator^= se definen por valores del tipo de máscara de bits y tienen la misma semántica que los correspondientes operadores integrados de enteros sin signo tendría si los elementos de máscara de bits son el número entero distinto potencias de dos .
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.
Las siguientes expresiones son bien formados y tienen el siguiente significado para cualquier 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 | establece el valor Y en el
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 | objeto X.. borra el valor Y en el
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 | objeto X.. indica que el valor Y se encuentra en el objeto X
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. |
Cada elemento de máscara de bits representible se define como un valor constexpr del tipo máscara de bits .
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.
[editar] Usage
Los siguientes tipos de biblioteca estándar satisfacer
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,
El código que se basa en alguna opción de implementación en particular (por ejemplo int n = std::ios_base::hex), es porque no portátil std::ios_base::fmtflags no necesariamente es implícitamente convertible a 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.