std::make_unsigned
De cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Defined in header <type_traits>
|
||
| template< class T > struct make_unsigned; |
(ya que C + +11) | |
Dada una integral (excepto bool) o
T tipo de enumeración, proporciona la type miembro typedef que es el tipo entero sin signo correspondiente a T, con los mismos calificadores-cv .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.
You can help to correct and verify the translation. Click here for instructions.
[editar] Tipos de miembros
| Nombre
Original: Name The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
type
|
el tipo entero sin signo correspondiente a
TOriginal: the unsigned integer type corresponding to TThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[editar] Ejemplo
#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
[editar] Ver también
| (C++11) |
Comprueba si un tipo se firmaron tipo aritmético Original: checks if a type is signed arithmetic type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (clase de plantilla) |
| (C++11) |
Comprueba si un tipo es el tipo de aritmética sin signo Original: checks if a type is unsigned arithmetic type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (clase de plantilla) |
| (C++11) |
hace que el tipo dado integral firmado Original: makes the given integral type signed The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (clase de plantilla) |