| [/ |
| Copyright 2007 John Maddock. |
| Distributed under the Boost Software License, Version 1.0. |
| (See accompanying file LICENSE_1_0.txt or copy at |
| http://www.boost.org/LICENSE_1_0.txt). |
| ] |
| |
| [section:is_class is_class] |
| template <class T> |
| struct is_class : public __tof {}; |
| |
| __inherit If T is a (possibly cv-qualified) class type then inherits from __true_type, |
| otherwise inherits from __false_type. |
| |
| __std_ref 3.9.2 and 9.2. |
| |
| __header ` #include <boost/type_traits/is_class.hpp>` or ` #include <boost/type_traits.hpp>` |
| |
| __compat Without (some as yet unspecified) help from the compiler, |
| we cannot distinguish between union and class types, as a result this type |
| will erroneously inherit from __true_type for union types. See also __is_union. |
| Currently (May 2005) only Visual C++ 8 has the necessary compiler __intrinsics to |
| correctly identify union types, and therefore make is_class function correctly. |
| |
| __examples |
| |
| [:Given: `class MyClass;` then:] |
| |
| [:`is_class<MyClass>` inherits from `__true_type`.] |
| |
| [:`is_class<MyClass const>::type` is the type `__true_type`.] |
| |
| [:`is_class<MyClass>::value` is an integral constant |
| expression that evaluates to /true/.] |
| |
| [:`is_class<MyClass&>::value` is an integral constant |
| expression that evaluates to /false/.] |
| |
| [:`is_class<MyClass*>::value` is an integral constant |
| expression that evaluates to /false/.] |
| |
| [:`is_class<T>::value_type` is the type `bool`.] |
| |
| [endsect] |
| |