summaryrefslogtreecommitdiff
path: root/libs/type_traits/doc/html/boost_typetraits/category/value_traits/primary.html
blob: d4710580c91e554e759e4a1c736257a3f3ef37f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Categorizing a Type</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="../../../index.html" title="Chapter&#160;1.&#160;Boost.TypeTraits">
<link rel="up" href="../value_traits.html" title="Type Traits that Describe the Properties of a Type">
<link rel="prev" href="../value_traits.html" title="Type Traits that Describe the Properties of a Type">
<link rel="next" href="properties.html" title="General Type Properties">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../value_traits.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../value_traits.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="properties.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section boost_typetraits_category_value_traits_primary">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_typetraits.category.value_traits.primary"></a><a class="link" href="primary.html" title="Categorizing a Type">Categorizing
        a Type</a>
</h4></div></div></div>
<p>
          These traits identify what "kind" of type some type <code class="computeroutput"><span class="identifier">T</span></code> is. These are split into two groups:
          primary traits which are all mutually exclusive, and composite traits that
          are compositions of one or more primary traits.
        </p>
<p>
          For any given type, exactly one primary type trait will inherit from <a class="link" href="../../reference/integral_constant.html" title="integral_constant">true_type</a>,
          and all the others will inherit from <a class="link" href="../../reference/integral_constant.html" title="integral_constant">false_type</a>,
          in other words these traits are mutually exclusive.
        </p>
<p>
          This means that <code class="computeroutput"><a class="link" href="../../reference/is_integral.html" title="is_integral">is_integral</a><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">value</span></code>
          and <code class="computeroutput"><a class="link" href="../../reference/is_floating_point.html" title="is_floating_point">is_floating_point</a><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">value</span></code>
          will only ever be true for built-in types; if you want to check for a user-defined
          class type that behaves "as if" it is an integral or floating
          point type, then use the <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">numeric_limits</span>
          <span class="keyword">template</span></code> instead.
        </p>
<p>
          <span class="bold"><strong>Synopsis:</strong></span>
        </p>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="../../reference/is_array.html" title="is_array">is_array</a><span class="special">;</span>

<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="../../reference/is_class.html" title="is_class">is_class</a><span class="special">;</span>

<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="../../reference/is_complex.html" title="is_complex">is_complex</a><span class="special">;</span>

<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="../../reference/is_enum.html" title="is_enum">is_enum</a><span class="special">;</span>

<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="../../reference/is_floating_point.html" title="is_floating_point">is_floating_point</a><span class="special">;</span>

<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="../../reference/is_function.html" title="is_function">is_function</a><span class="special">;</span>

<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="../../reference/is_integral.html" title="is_integral">is_integral</a><span class="special">;</span>

<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="../../reference/is_member_function_pointer.html" title="is_member_function_pointer">is_member_function_pointer</a><span class="special">;</span>

<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="../../reference/is_member_object_pointer.html" title="is_member_object_pointer">is_member_object_pointer</a><span class="special">;</span>

<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="../../reference/is_pointer.html" title="is_pointer">is_pointer</a><span class="special">;</span>

<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="../../reference/is_lvalue_reference.html" title="is_lvalue_reference">is_lvalue_reference</a><span class="special">;</span>

<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="../../reference/is_rvalue_reference.html" title="is_rvalue_reference">is_rvalue_reference</a><span class="special">;</span>

<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="../../reference/is_union.html" title="is_union">is_union</a><span class="special">;</span>

<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="../../reference/is_void.html" title="is_void">is_void</a><span class="special">;</span>
</pre>
<p>
          The following traits are made up of the union of one or more type categorizations.
          A type may belong to more than one of these categories, in addition to
          one of the primary categories.
        </p>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="../../reference/is_arithmetic.html" title="is_arithmetic">is_arithmetic</a><span class="special">;</span>

<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="../../reference/is_compound.html" title="is_compound">is_compound</a><span class="special">;</span>

<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="../../reference/is_fundamental.html" title="is_fundamental">is_fundamental</a><span class="special">;</span>

<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="../../reference/is_member_pointer.html" title="is_member_pointer">is_member_pointer</a><span class="special">;</span>

<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="../../reference/is_object.html" title="is_object">is_object</a><span class="special">;</span>

<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="../../reference/is_reference.html" title="is_reference">is_reference</a><span class="special">;</span>

<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">struct</span> <a class="link" href="../../reference/is_scalar.html" title="is_scalar">is_scalar</a><span class="special">;</span>
</pre>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2000, 2011 Adobe Systems Inc, David Abrahams,
      Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
      Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
      Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
      Watanabe<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../value_traits.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../value_traits.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="properties.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>