std::is_scalar
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. |
Elemento definito nell'header <type_traits>
|
||
template< class T > struct is_scalar; |
(dal C++11) | |
Se
T
è un tipo scalare (cioè, tipo aritmetico, tipo di enumerazione, puntatore, puntatore a membro, o std::nullptr_t, compresi eventuali cv-qualificati varianti), fornisce il membro costante value
true uguali. Per qualsiasi altro tipo, è value
false.Original:
If
T
is a scalar type (that is, arithmetic type, enumeration type, pointer, pointer to member, or std::nullptr_t, including any cv-qualified variants), provides the member constant value
equal true. For any other type, value
is false.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.
Indice |
Inherited from std::integral_constant
Member constants
value [statico] |
true se T is a scalar type , false altrimenti Original: true if T is a scalar type , false otherwise The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (pubblico membro statico costante) |
Member functions
operator bool |
converte l'oggetto in bool, restituisce value Original: converts the object to bool, returns value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (metodo pubblico) |
Member types
Tipo
Original: Type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
value_type
|
bool
|
type
|
std::integral_constant<bool, value> |
[modifica] Note
Ogni locazione di memoria individuale in memoria del modello C + +, comprese le locazioni di memoria nascosti utilizzati da funzionalità del linguaggio (ad esempio puntatore tabella virtuale), è di tipo scalare (o è una sequenza di bit-field adiacenti di lunghezza diversa da zero). Il sequenziamento di effetti collaterali nella valutazione dell'espressione, la sincronizzazione interthread, e la dipendenza di ordinazione, sono tutti definiti in termini di oggetti scalari singoli.
Original:
Each individual memory location in the C++ memory model, including the hidden memory locations used by language features (e.g virtual table pointer), has scalar type (or is a sequence of adjacent bit-fields of non-zero length). Sequencing of side-effects in expression evaluation, interthread synchronization, and dependency ordering are all defined in terms of individual scalar objects.
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] Possibile implementazione
template< class T > struct is_scalar : std::integral_constant<bool, std::is_arithmetic<T>::value || std::is_enum<T>::value || std::is_pointer<T>::value || std::is_member_pointer<T>::value || std::is_same<std::nullptr_t, typename std::remove_cv<T>::type>::value> {}; |
[modifica] Esempio
Output:
T is scalar T is not a scalar
[modifica] Vedi anche
(C++11) |
Verifica se un tipo è di tipo aritmetico Original: checks if a type is arithmetic type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
(C++11) |
Verifica se un tipo è un tipo di enumerazione Original: checks if a type is an enumeration type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
(C++11) |
Verifica se un tipo è un tipo di puntatore Original: checks if a type is a pointer type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
(C++11) |
checks if a type is a pointer to a non-static member function or object (classe template) |