std::is_compound
提供: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 is_compound; |
(C + + 11以来) | |
T複合型(つまり、任意のcv-修飾変異体を含む配列、関数、オブジェクトポインタ、関数ポインタ、メンバオブジェクトポインタ、メンバ関数ポインタ、参照、クラス、共用体、または列挙型)である場合は、会員が一定提供value等しいtrue。その他のタイプのために、valuefalseです.Original:
If
T is a compound type (that is, array, function, object pointer, function pointer, member object pointer, member function pointer, reference, class, union, or enumeration, 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.
目次 |
Inherited from std::integral_constant
Member constants
| value [静的] |
true T is a compound type もし、そうでなければfalse Original: true if T is a compound 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. (公共の静的メンバ定数) |
Member functions
| operator bool |
boolにオブジェクトは、 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. (パブリックメンバ関数) |
Member types
| タイプ
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> |
[編集] ノート
化合物の種類は、基本型から構成されているタイプです。どのようなC + +の型のいずれかの基本的なまたは化合物である.
Original:
Compound types are the types that are constructed from fundamental types. Any C++ type is either fundamental or compound.
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.
[編集] 可能な実装
template< class T > struct is_compound : std::integral_constant<bool, !std::is_fundamental<T>::value> {}; |
[編集] 例
#include <iostream> #include <type_traits> int main() { class cls {}; std::cout << (std::is_compound<cls>::value ? "T is compound" : "T is not a compound") << '\n'; std::cout << (std::is_compound<int>::value ? "T is compound" : "T is not a compound") << '\n'; }
Output:
T is compound T is not a compound
[編集] も参照してください
| (C++11) |
タイプかどうかをチェックするには、基本的なタイプです Original: checks if a type is fundamental 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 scalar 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 object 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 an array type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (クラステンプレート) |