std::decay
提供: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 decay; |
(C + + 11以来) | |
、型
Tに左辺値から右辺値、配列からポインタや関数ポインタへの暗黙的な変換を適用するのcv-修飾子を削除し、メンバのtypedeftypeとして結果の型を定義します。これは、値によって渡されるすべての関数の引数に適用される型変換です.Original:
Applies lvalue-to-rvalue, array-to-pointer, and function-to-pointer implicit conversions to the type
T, removes cv-qualifiers, and defines the resulting type as the member typedef type. This is the type conversion applied to all function arguments when passed by value.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 result of applying the decay type conversions to T The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[編集] 可能な実装
template< class T > struct decay { typedef typename std::remove_reference<T>::type U; typedef typename std::conditional< std::is_array<U>::value, typename std::remove_extent<U>::type*, typename std::conditional< std::is_function<U>::value, typename std::add_pointer<U>::type, typename std::remove_cv<U>::type >::type >::type type; }; |
[編集] 例
| This section is incomplete Reason: no example |
[編集] も参照してください
| implicit conversion | 配列からポインタ、関数へのポインタ、右辺から左辺値への変換
Original: array-to-pointer, function-to-pointer, rvalue-to-lvalue conversions The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |