Categorizing a Type

| Home | Libraries | People | FAQ | More

#### Categorizing a Type

These traits identify what "kind" of type some type `T` is. These are split into two groups: primary traits which are all mutually exclusive, and composite traits that are compositions of one or more primary traits.

For any given type, exactly one primary type trait will inherit from true_type, and all the others will inherit from false_type, in other words these traits are mutually exclusive.

This means that `is_integral<T>::value` and `is_floating_point<T>::value` will only ever be true for built-in types; if you want to check for a user-defined class type that behaves "as if" it is an integral or floating point type, then use the `std::numeric_limits template` instead.

Synopsis:

    template <class T>
    struct is_array<T>;

    template <class T>
    struct is_class<T>;

    template <class T>
    struct is_complex<T>;

    template <class T>
    struct is_enum<T>;

    template <class T>
    struct is_floating_point<T>;

    template <class T>
    struct is_function<T>;

    template <class T>
    struct is_integral<T>;

    template <class T>
    struct is_member_function_pointer<T>;

    template <class T>
    struct is_member_object_pointer<T>;

    template <class T>
    struct is_pointer<T>;

    template <class T>
    struct is_reference<T>;

    template <class T>
    struct is_union<T>;

    template <class T>
    struct is_void<T>;

The following traits are made up of the union of one or more type categorizations. A type may belong to more than one of these categories, in addition to one of the primary categories.

    template <class T>
    struct is_arithmetic;

    template <class T>
    struct is_compound;

    template <class T>
    struct is_fundamental;

    template <class T>
    struct is_member_pointer;

    template <class T>
    struct is_object;

    template <class T>
    struct is_scalar;