Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

is_object

template <class T>
struct is_object : public true_type-or-false_type {};

Inherits: If T is a (possibly cv-qualified) object type then inherits from true_type, otherwise inherits from false_type. All types are object types except references, void, and function types.

C++ Standard Reference: 3.9p9.

Compiler Compatibility: All current compilers are supported by this trait.

Header: #include <boost/type_traits/is_object.hpp> or #include <boost/type_traits.hpp>

Examples:

is_object<int> inherits from true_type.

is_object<int*>::type is the type true_type.

is_object<int (*)(void)>::value is an integral constant expression that evaluates to true.

is_object<int (MyClass::*)(void)const>::value is an integral constant expression that evaluates to true.

is_object<int &>::value is an integral constant expression that evaluates to false: reference types are not objects

is_object<int (double)>::value is an integral constant expression that evaluates to false: function types are not objects

is_object<const void>::value is an integral constant expression that evaluates to false: void is not an object type

is_object<T>::value_type is the type bool.


PrevUpHomeNext