is_signed.qbk 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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_signed is_signed]
  8. template <class T>
  9. struct is_signed : public __tof {};
  10. __inherit If T is an signed integer type or an enumerated type with an
  11. underlying signed integer type, then inherits from __true_type,
  12. otherwise inherits from __false_type.
  13. __std_ref 3.9.1, 7.2.
  14. [all_compilers]
  15. __header ` #include <boost/type_traits/is_signed.hpp>` or ` #include <boost/type_traits.hpp>`
  16. __examples
  17. [:`is_signed<int>` inherits from `__true_type`.]
  18. [:`is_signed<int const volatile>::type` is the type `__true_type`.]
  19. [:`is_signed<unsigned int>::value` is an integral constant
  20. expression that evaluates to /false/.]
  21. [:`is_signed<myclass>::value` is an integral constant
  22. expression that evaluates to /false/.]
  23. [:`is_signed<char>::value` is an integral constant
  24. expression whose value depends upon the signedness of type `char`.]
  25. [:`is_signed<long long>::value` is an integral constant
  26. expression that evaluates to /true/.]
  27. [:`is_signed<T>::value_type` is the type `bool`.]
  28. [endsect]