blob: 745f483b96defe405ea4bcd5b89ccf535453611a [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_scalar is_scalar]
9 template <class T>
10 struct is_scalar : public __tof {};
11
12__inherit If T is a (possibly cv-qualified) scalar type then inherits from
13__true_type, otherwise inherits from __false_type. Scalar types include
14integral, floating point, enumeration, pointer, and pointer-to-member types.
15
16__std_ref 3.9p10.
17
18__header ` #include <boost/type_traits/is_scalar.hpp>` or ` #include <boost/type_traits.hpp>`
19
20[all_compilers]
21
22__examples
23
24[:`is_scalar<int*>` inherits from `__true_type`.]
25
26[:`is_scalar<int>::type` is the type `__true_type`.]
27
28[:`is_scalar<double>::value` is an integral constant
29expression that evaluates to /true/.]
30
31[:`is_scalar<int (*)(long)>::value` is an integral constant
32expression that evaluates to /true/.]
33
34[:`is_scalar<int (MyClass::*)(long)>::value` is an integral constant
35expression that evaluates to /true/.]
36
37[:`is_scalar<int (MyClass::*)>::value` is an integral constant
38expression that evaluates to /true/.]
39
40[:`is_scalar<T>::value_type` is the type `bool`.]
41
42[endsect]
43