is_object.qbk 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. [/
  2. Copyright 2007 John Maddock.
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt).
  6. ]
  7. [section:is_object is_object]
  8. template <class T>
  9. struct is_object : public __tof {};
  10. __inherit If T is a (possibly cv-qualified) object type
  11. then inherits from __true_type,
  12. otherwise inherits from __false_type. All types are object types except
  13. references, void, and function types.
  14. __std_ref 3.9p9.
  15. [all_compilers]
  16. __header ` #include <boost/type_traits/is_object.hpp>` or ` #include <boost/type_traits.hpp>`
  17. __examples
  18. [:`is_object<int>` inherits from `__true_type`.]
  19. [:`is_object<int*>::type` is the type `__true_type`.]
  20. [:`is_object<int (*)(void)>::value` is an integral constant
  21. expression that evaluates to /true/.]
  22. [:`is_object<int (MyClass::*)(void)const>::value` is an integral constant
  23. expression that evaluates to /true/.]
  24. [:`is_object<int &>::value` is an integral constant
  25. expression that evaluates to /false/: reference types are not objects]
  26. [:`is_object<int (double)>::value` is an integral constant
  27. expression that evaluates to /false/: function types are not objects]
  28. [:`is_object<const void>::value` is an integral constant
  29. expression that evaluates to /false/: void is not an object type]
  30. [:`is_object<T>::value_type` is the type `bool`.]
  31. [endsect]