summaryrefslogtreecommitdiff
path: root/doc/html/boost_typetraits.html
blob: 05aafa659d50fa815814404d55f6659dadb66efa (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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Chapter 14. Boost.TypeTraits</title>
<link rel="stylesheet" href="boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
<link rel="start" href="index.html" title="The Boost C++ Libraries">
<link rel="up" href="libraries.html" title="Part I. The Boost C++ Libraries">
<link rel="prev" href="tribool/tests.html" title="Testsuite">
<link rel="next" href="boost_typetraits/background.html" title=" Background and Tutorial">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%">
<td valign="top"><img alt="boost.png (6897 bytes)" width="277" height="86" src="../../boost.png"></td>
<td align="center"><a href="../../index.htm">Home</a></td>
<td align="center"><a href="../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="../../people/people.htm">People</a></td>
<td align="center"><a href="../../more/faq.htm">FAQ</a></td>
<td align="center"><a href="../../more/index.htm">More</a></td>
</table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="tribool/tests.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="libraries.html"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="boost_typetraits/background.html"><img src="images/next.png" alt="Next"></a>
</div>
<div class="chapter" lang="en">
<div class="titlepage"><div>
<div><h2 class="title">
<a name="boost_typetraits"></a>Chapter 14. Boost.TypeTraits</h2></div>
<div><div class="author"><h3 class="author">
<span class="firstname">various</span> <span class="surname">authors</span>
</h3></div></div>
<div><p class="copyright">Copyright © 2000, 2005 Adobe Systems Inc, David Abrahams, Steve Cleary, 
    Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat Marcus, 
    Itay Maman, John Maddock, Thorsten Ottosen, Robert Ramey and Jeremy Siek</p></div>
<div><div class="legalnotice">
<a name="id1572446"></a><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></div>
</div></div>
<div class="toc">
<p><b>Table of Contents</b></p>
<dl>
<dt><span class="section"><a href="boost_typetraits.html#boost_typetraits.intro"> Introduction</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/background.html"> Background and Tutorial</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/category.html"> Type Traits by Category</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="boost_typetraits/category.html#boost_typetraits.value_traits"> Type Traits that Describe the Properties of a Type</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/category.html#boost_typetraits.transform"> Type Traits that Transform One Type to Another</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/category.html#boost_typetraits.alignment"> Synthesizing Types with Specific Alignments</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/category.html#boost_typetraits.function"> Decomposing Function Types</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="boost_typetraits/user_defined.html"> User Defined Specializations</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/intrinsics.html"> Support for Compiler Intrinsics</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/mpl.html"> MPL Interoperability</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/examples.html"> Examples</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="boost_typetraits/examples.html#boost_typetraits.copy"> An Optimized Version of std::copy</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/examples.html#boost_typetraits.fill"> An Optimised Version of std::fill</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/examples.html#boost_typetraits.destruct"> An Example that Omits Destructor Calls For Types with Trivial Destructors</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/examples.html#boost_typetraits.iter"> An improved Version of std::iter_swap</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="boost_typetraits/reference.html"> Alphabetical Reference</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.add_const"> add_const</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.add_cv"> add_cv</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.add_pointer"> add_pointer</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.add_reference"> add_reference</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.add_volatile"> add_volatile</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.aligned_storage"> aligned_storage</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.alignment_of"> alignment_of</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.extent"> extent</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.function_traits"> function_traits</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.has_nothrow_assign"> has_nothrow_assign</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.has_nothrow_constructor"> has_nothrow_constructor</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.has_nothrow_copy"> has_nothrow_copy</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.has_trivial_assign"> has_trivial_assign</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.has_trivial_constructor"> has_trivial_constructor</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.has_trivial_copy"> has_trivial_copy</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.has_trivial_destructor"> has_trivial_destructor</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.has_virtual_destructor"> has_virtual_destructor</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.integral_constant"> integral_constant</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_abstract"> is_abstract</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_arithmetic"> is_arithmetic</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_array"> is_array</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_base_of"> is_base_of</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_class"> is_class</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_compound"> is_compound</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_const"> is_const</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_convertible"> is_convertible</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_empty"> is_empty</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_enum"> is_enum</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_floating_point"> is_floating_point</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_function"> is_function</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_fundamental"> is_fundamental</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_integral"> is_integral</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_member_function_pointer"> is_member_function_pointer</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_member_object_pointer"> is_member_object_pointer</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_member_pointer"> is_member_pointer</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_object"> is_object</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_pod"> is_pod</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_pointer"> is_pointer</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_polymorphic"> is_polymorphic</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_same"> is_same</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_scalar"> is_scalar</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_stateless"> is_stateless</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_reference"> is_reference</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_union"> is_union</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_void"> is_void</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.is_volatile"> is_volatile</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.rank"> rank</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.remove_all_extents"> remove_all_extents</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.remove_const"> remove_const</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.remove_cv"> remove_cv</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.remove_extent"> remove_extent</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.remove_pointer"> remove_pointer</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.remove_reference"> remove_reference</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.remove_volatile"> remove_volatile</a></span></dt>
<dt><span class="section"><a href="boost_typetraits/reference.html#boost_typetraits.type_with_alignment"> type_with_alignment</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="boost_typetraits/credits.html"> Credits</a></span></dt>
</dl>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_typetraits.intro"></a> Introduction</h3></div></div></div>
<p>
The Boost type-traits library contains a 
set of very specific traits classes, each of which encapsulate a single trait 
from the C++ type system; for example, is a type a pointer or a reference type? 
Or does a type have a trivial constructor, or a const-qualifier?</p>
<p>
The type-traits classes share a unified design: each class inherits from a 
the type <a href="boost_typetraits/reference.html#boost_typetraits.integral_constant" title=" integral_constant">true_type</a> if the type has the specified property and inherits from
<a href="boost_typetraits/reference.html#boost_typetraits.integral_constant" title=" integral_constant">false_type</a> otherwise.</p>
<p>
The type-traits library also contains a set of classes that perform a 
specific transformation on a type; for example, they can remove a 
top-level const or volatile qualifier from a type. Each class that 
performs a transformation defines a single typedef-member <code class="computeroutput"><span class="identifier">type</span></code> 
that is the result of the transformation.</p>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"><small><p>Last revised: May 11, 2005 at 14:32:21 GMT</p></small></td>
<td align="right"><small></small></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="tribool/tests.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="libraries.html"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="boost_typetraits/background.html"><img src="images/next.png" alt="Next"></a>
</div>
</body>
</html>