is_scalar.qbk 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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_scalar is_scalar]
  8. template <class T>
  9. struct is_scalar : public __tof {};
  10. __inherit If T is a (possibly cv-qualified) scalar type then inherits from
  11. __true_type, otherwise inherits from __false_type. Scalar types include
  12. integral, floating point, enumeration, pointer, and pointer-to-member types.
  13. __std_ref 3.9p10.
  14. __header ` #include <boost/type_traits/is_scalar.hpp>` or ` #include <boost/type_traits.hpp>`
  15. [all_compilers]
  16. __examples
  17. [:`is_scalar<int*>` inherits from `__true_type`.]
  18. [:`is_scalar<int>::type` is the type `__true_type`.]
  19. [:`is_scalar<double>::value` is an integral constant
  20. expression that evaluates to /true/.]
  21. [:`is_scalar<int (*)(long)>::value` is an integral constant
  22. expression that evaluates to /true/.]
  23. [:`is_scalar<int (MyClass::*)(long)>::value` is an integral constant
  24. expression that evaluates to /true/.]
  25. [:`is_scalar<int (MyClass::*)>::value` is an integral constant
  26. expression that evaluates to /true/.]
  27. [:`is_scalar<T>::value_type` is the type `bool`.]
  28. [endsect]