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