Freigeben über


is_compound-Klasse

Testet, ob der angegebene Typ nicht wichtig ist.

template<class Ty>
    struct is_compound;

Parameter

  • Ty
    Der Typ in Abfragen.

Hinweise

Eine Instanz des Typprädikats enthält false an, wenn der Typ von Ty ist ein einfacher Typ, (das heißt, wenn is_fundamental<Ty>true); enthält Andernfalls enthält sie true. Daher enthält das Prädikat true, wenn Ty ein Arraytyp, ein Funktionstyp, der Zeiger void oder ein Objekt oder eine Funktion, ein Verweis, eine Klasse, eine Union, Enumeration oder ein Zeiger an nicht statischen Klassenmember ist, oder ein Lebenslauf-qualifiziertes Form einer von ihnen.

Beispiel

 

// std_tr1__type_traits__is_compound.cpp 
// compile with: /EHsc 
#include <type_traits> 
#include <iostream> 
 
struct trivial 
    { 
    int val; 
    }; 
 
int main() 
    { 
    std::cout << "is_compound<trivial> == " << std::boolalpha 
        << std::is_compound<trivial>::value << std::endl; 
    std::cout << "is_compound<int[]> == " << std::boolalpha 
        << std::is_compound<int[]>::value << std::endl; 
    std::cout << "is_compound<int()> == " << std::boolalpha 
        << std::is_compound<int()>::value << std::endl; 
    std::cout << "is_compound<int&> == " << std::boolalpha 
        << std::is_compound<int&>::value << std::endl; 
    std::cout << "is_compound<void *> == " << std::boolalpha 
        << std::is_compound<void *>::value << std::endl; 
    std::cout << "is_compound<int> == " << std::boolalpha 
        << std::is_compound<int>::value << std::endl; 
 
    return (0); 
    } 
 
  

Anforderungen

Header: <type_traits>

Namespace: std

Siehe auch

Referenz

<type_traits>

is_class-Klasse

Weitere Ressourcen

<type_traits> Member