Brian Silverman | 4a2409e | 2018-08-04 23:24:02 -0700 | [diff] [blame^] | 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 | |
| 8 | [section:is_signed is_signed] |
| 9 | |
| 10 | template <class T> |
| 11 | struct is_signed : public __tof {}; |
| 12 | |
| 13 | __inherit If T is an signed integer type or an enumerated type with an |
| 14 | underlying signed integer type, then inherits from __true_type, |
| 15 | otherwise inherits from __false_type. |
| 16 | |
| 17 | __std_ref 3.9.1, 7.2. |
| 18 | |
| 19 | [all_compilers] |
| 20 | |
| 21 | __header ` #include <boost/type_traits/is_signed.hpp>` or ` #include <boost/type_traits.hpp>` |
| 22 | |
| 23 | __examples |
| 24 | |
| 25 | [:`is_signed<int>` inherits from `__true_type`.] |
| 26 | |
| 27 | [:`is_signed<int const volatile>::type` is the type `__true_type`.] |
| 28 | |
| 29 | [:`is_signed<unsigned int>::value` is an integral constant |
| 30 | expression that evaluates to /false/.] |
| 31 | |
| 32 | [:`is_signed<myclass>::value` is an integral constant |
| 33 | expression that evaluates to /false/.] |
| 34 | |
| 35 | [:`is_signed<char>::value` is an integral constant |
| 36 | expression whose value depends upon the signedness of type `char`.] |
| 37 | |
| 38 | [:`is_signed<long long>::value` is an integral constant |
| 39 | expression that evaluates to /true/.] |
| 40 | |
| 41 | [:`is_signed<T>::value_type` is the type `bool`.] |
| 42 | |
| 43 | [endsect] |
| 44 | |