blob: 585327498bd43841ed9642fdee6d7110757f967c [file] [log] [blame]
Brian Silverman4a2409e2018-08-04 23:24:02 -07001[/
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,
14otherwise 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
29expression that evaluates to /true/.]
30
31[:`is_const<int const*>::value` is an integral constant
32expression that evaluates to /false/: the const-qualifier is not
33at the top level in this case.]
34
35[:`is_const<int const&>::value` is an integral constant
36expression that evaluates to /false/: the const-qualifier is not
37at the top level in this case.]
38
39[:`is_const<int>::value` is an integral constant
40expression that evaluates to /false/.]
41
42[:`is_const<T>::value_type` is the type `bool`.]
43
44[endsect]
45