std::make_unsigned - cppreference.com
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>
| Elemento definito nell'header <type_traits> |
||
|
|
(dal C++11) | |
Dato un integrale (tranne bool) o tipo T enumerazione, fornisce la type membro typedef che è il tipo intero senza segno corrispondente a T, con lo stesso cv-qualificazioni.
Original:
Given an integral (except bool) or enumeration type T, provides the member typedef type which is the unsigned integer type corresponding to T, with the same cv-qualifiers.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Membri tipi
Nome Original: Name The text has been machine-translated via Google Translate. |
Definition |
type
|
il tipo intero senza segno corrispondente a Original: the unsigned integer type corresponding to The text has been machine-translated via Google Translate. |
Esempio
#include <iostream> #include <type_traits> int main() { typedef std::make_unsigned<char>::type char_type; typedef std::make_unsigned<int>::type int_type; typedef std::make_unsigned<volatile long>::type long_type; bool ok1 = std::is_same<char_type, unsigned char>::value; bool ok2 = std::is_same<int_type, unsigned int>::value; bool ok3 = std::is_same<long_type, volatile unsigned long>::value; std::cout << std::boolalpha << "char_type is 'unsigned char'? : " << ok1 << '\n' << "int_type is 'unsigned int'? : " << ok2 << '\n' << "long_type is 'volatile unsigned long'? : " << ok3 << '\n'; }
Output:
char_type is 'unsigned char'? : true int_type is 'unsigned int'? : true long_type is 'volatile unsigned long'? : true
Vedi anche
(C++11) |
controlla se un tipo è firmato tipo aritmetico Original: checks if a type is signed arithmetic type The text has been machine-translated via Google Translate. (classe template) [modifica] |
(C++11) |
Verifica se un tipo è di tipo aritmetico senza segno Original: checks if a type is unsigned arithmetic type The text has been machine-translated via Google Translate. (classe template) [modifica] |
(C++11) |
rende il dato tipo integrale firmato Original: makes the given integral type signed The text has been machine-translated via Google Translate. (classe template) [modifica] |