std::make_unsigned
提供: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; |
(C + + 11以来) | |
与えられた整数型または列挙型
T、同じのcv-修飾子を使用して、typeに対応する符号なし整数型であるメンバのtypedefTを提供しています(ブール値を除く).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.
[編集] メンバータイプ
| 名前
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
|
Tに対応する符号なし整数型Original: 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. |
[編集] 例
#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
[編集] も参照してください
| (C++11) |
型が算術型を締結しているかどうかを確認する 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. (クラステンプレート) |
| (C++11) |
タイプかどうかをチェックするには、符号なし算術型である 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. (クラステンプレート) |
| (C++11) |
与えられた整数型は符号付きになります 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. (クラステンプレート) |