is_reference.qbk 1017 B

12345678910111213141516171819202122232425262728293031323334353637
  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_reference is_reference]
  8. template <class T>
  9. struct is_reference : public __tof {};
  10. __inherit If T is a reference type (either an lvalue reference or an rvalue reference)
  11. then inherits from __true_type,
  12. otherwise inherits from __false_type.
  13. __std_ref 3.9.2 and 8.3.2.
  14. [all_compilers]
  15. __header ` #include <boost/type_traits/is_reference.hpp>` or ` #include <boost/type_traits.hpp>`
  16. __examples
  17. [:`is_reference<int&>` inherits from `__true_type`.]
  18. [:`is_reference<int const&>::type` is the type `__true_type`.]
  19. [:`is_reference<int const&&>::type` is the type `__true_type`.]
  20. [:`is_reference<int (&)(long)>::value` is an integral constant
  21. expression that evaluates to /true/ (the argument in this case is
  22. a reference to a function).]
  23. [:`is_reference<T>::value_type` is the type `bool`.]
  24. [endsect]