is_const.qbk 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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_const is_const]
  8. template <class T>
  9. struct is_const : public __tof {};
  10. __inherit If T is a (top level) const-qualified type then inherits from __true_type,
  11. otherwise inherits from __false_type.
  12. __std_ref 3.9.3.
  13. __header ` #include <boost/type_traits/is_const.hpp>` or ` #include <boost/type_traits.hpp>`
  14. [all_compilers]
  15. __examples
  16. [:`is_const<int const>` inherits from `__true_type`.]
  17. [:`is_const<int const volatile>::type` is the type `__true_type`.]
  18. [:`is_const<int* const>::value` is an integral constant
  19. expression that evaluates to /true/.]
  20. [:`is_const<int const*>::value` is an integral constant
  21. expression that evaluates to /false/: the const-qualifier is not
  22. at the top level in this case.]
  23. [:`is_const<int const&>::value` is an integral constant
  24. expression that evaluates to /false/: the const-qualifier is not
  25. at the top level in this case.]
  26. [:`is_const<int>::value` is an integral constant
  27. expression that evaluates to /false/.]
  28. [:`is_const<T>::value_type` is the type `bool`.]
  29. [endsect]