is_same.qbk 986 B

123456789101112131415161718192021222324252627282930313233343536373839
  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_same is_same]
  8. template <class T, class U>
  9. struct is_same : public __tof {};
  10. __inherit If T and U are the same types then inherits from
  11. __true_type, otherwise inherits from __false_type.
  12. __header ` #include <boost/type_traits/is_same.hpp>` or ` #include <boost/type_traits.hpp>`
  13. [all_compilers]
  14. __examples
  15. [:`is_same<int, int>` inherits from `__true_type`.]
  16. [:`is_same<int, int>::type` is the type `__true_type`.]
  17. [:`is_same<int, int>::value` is an integral constant
  18. expression that evaluates to /true/.]
  19. [:`is_same<int const, int>::value` is an integral constant
  20. expression that evaluates to /false/.]
  21. [:`is_same<int&, int>::value` is an integral constant
  22. expression that evaluates to /false/.]
  23. [:`is_same<T, T>::value_type` is the type `bool`.]
  24. [endsect]