3
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4
<title>Chapter 32. Boost.Units 1.1.0</title>
5
<link rel="stylesheet" href="../../doc/src/boostbook.css" type="text/css">
6
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7
<link rel="home" href="index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
8
<link rel="up" href="libraries.html" title="Part I. The Boost C++ Libraries (BoostBook Subset)">
9
<link rel="prev" href="typeof/ackn.html" title="Acknowledgements">
10
<link rel="next" href="boost_units/Quick_Start.html" title="Quick Start">
12
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13
<table cellpadding="2" width="100%"><tr>
14
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../boost.png"></td>
15
<td align="center"><a href="../../index.html">Home</a></td>
16
<td align="center"><a href="../../libs/libraries.htm">Libraries</a></td>
17
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19
<td align="center"><a href="../../more/index.htm">More</a></td>
22
<div class="spirit-nav">
23
<a accesskey="p" href="typeof/ackn.html"><img src="../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="libraries.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="boost_units/Quick_Start.html"><img src="../../doc/src/images/next.png" alt="Next"></a>
26
<div class="titlepage"><div>
27
<div><h2 class="title">
28
<a name="boost_units"></a>Chapter 32. Boost.Units 1.1.0</h2></div>
29
<div><div class="author"><h3 class="author">
30
<span class="firstname">Matthias C.</span> <span class="surname">Schabel</span>
32
<div><div class="author"><h3 class="author">
33
<span class="firstname">Steven</span> <span class="surname">Watanabe</span>
35
<div><p class="copyright">Copyright © 2003-2008 Matthias Christian Schabel</p></div>
36
<div><p class="copyright">Copyright © 2007-2010 Steven
38
<div><div class="legalnotice">
39
<a name="boost_units.legal"></a><p>
40
Distributed under the Boost Software License, Version 1.0. (See accompanying
41
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>)
46
<p><b>Table of Contents</b></p>
48
<dt><span class="section"><a href="boost_units.html#boost_units.Introduction">Introduction</a></span></dt>
49
<dt><span class="section"><a href="boost_units/Quick_Start.html">Quick Start</a></span></dt>
50
<dt><span class="section"><a href="boost_units/Dimensional_Analysis.html">Dimensional Analysis</a></span></dt>
51
<dt><span class="section"><a href="boost_units/Units.html">Units</a></span></dt>
53
<dt><span class="section"><a href="boost_units/Units.html#boost_units.Units.base_units">Base Units</a></span></dt>
54
<dt><span class="section"><a href="boost_units/Units.html#boost_units.Units.scaled_base_units">Scaled Base Units</a></span></dt>
55
<dt><span class="section"><a href="boost_units/Units.html#boost_units.Units.scaled_units">Scaled Units</a></span></dt>
57
<dt><span class="section"><a href="boost_units/Quantities.html">Quantities</a></span></dt>
59
<dt><span class="section"><a href="boost_units/Quantities.html#boost_units.Quantities.Heterogeneous_Operators">Heterogeneous
60
Operators</a></span></dt>
61
<dt><span class="section"><a href="boost_units/Quantities.html#boost_units.Quantities.Conversions">Conversions</a></span></dt>
62
<dt><span class="section"><a href="boost_units/Quantities.html#boost_units.Quantities.Quantity_Construction_and_Conversion">Construction
63
and Conversion of Quantities</a></span></dt>
65
<dt><span class="section"><a href="boost_units/Examples.html">Examples</a></span></dt>
67
<dt><span class="section"><a href="boost_units/Examples.html#boost_units.Examples.DimensionExample">Dimension Example</a></span></dt>
68
<dt><span class="section"><a href="boost_units/Examples.html#boost_units.Examples.UnitExample">Unit Example</a></span></dt>
69
<dt><span class="section"><a href="boost_units/Examples.html#boost_units.Examples.QuantityExample">Quantity Example</a></span></dt>
70
<dt><span class="section"><a href="boost_units/Examples.html#boost_units.Examples.KitchenSinkExample">Kitchen Sink
71
Example using SI units</a></span></dt>
72
<dt><span class="section"><a href="boost_units/Examples.html#boost_units.Examples.ConversionExample">Conversion Example</a></span></dt>
73
<dt><span class="section"><a href="boost_units/Examples.html#boost_units.Examples.UDTExample">User Defined Types</a></span></dt>
74
<dt><span class="section"><a href="boost_units/Examples.html#boost_units.Examples.ComplexExample">Complex Example</a></span></dt>
75
<dt><span class="section"><a href="boost_units/Examples.html#boost_units.Examples.PerformanceExample">Performance
76
Example</a></span></dt>
77
<dt><span class="section"><a href="boost_units/Examples.html#boost_units.Examples.RadarBeamHeightExample">Radar Beam
78
Height</a></span></dt>
79
<dt><span class="section"><a href="boost_units/Examples.html#boost_units.Examples.HeterogeneousUnitExample">Heterogeneous
80
Unit Example</a></span></dt>
81
<dt><span class="section"><a href="boost_units/Examples.html#boost_units.Examples.AbsoluteRelativeTemperatureExample">Absolute
82
and Relative Temperature Example</a></span></dt>
83
<dt><span class="section"><a href="boost_units/Examples.html#boost_units.Examples.RuntimeConversionFactorExample">Runtime
84
Conversion Factor Example</a></span></dt>
85
<dt><span class="section"><a href="boost_units/Examples.html#boost_units.Examples.UnitsWithNonbaseDimensions">Units
86
with Non-base Dimensions</a></span></dt>
87
<dt><span class="section"><a href="boost_units/Examples.html#boost_units.Examples.OutputForCompositeUnits">Output
88
for Composite Units</a></span></dt>
89
<dt><span class="section"><a href="boost_units/Examples.html#boost_units.Examples.autoscale">Automatically Scaled
91
<dt><span class="section"><a href="boost_units/Examples.html#boost_units.Examples.ConversionFactor">Conversion Factor</a></span></dt>
92
<dt><span class="section"><a href="boost_units/Examples.html#boost_units.Examples.RuntimeUnits">Runtime Units</a></span></dt>
93
<dt><span class="section"><a href="boost_units/Examples.html#boost_units.Examples.lambda">Interoperability with Boost.Lambda</a></span></dt>
95
<dt><span class="section"><a href="boost_units/Utilities.html">Utilities</a></span></dt>
97
<dt><span class="section"><a href="boost_units/Utilities.html#boost_units.Utilities.Metaprogramming_Classes">Metaprogramming
98
Classes</a></span></dt>
99
<dt><span class="section"><a href="boost_units/Utilities.html#boost_units.Utilities.Metaprogramming_Predicates">Metaprogramming
100
Predicates</a></span></dt>
102
<dt><span class="section"><a href="boost_units/Reference.html">Reference</a></span></dt>
104
<dt><span class="section"><a href="boost_units/Reference.html#units_reference">Units Reference</a></span></dt>
105
<dt><span class="section"><a href="boost_units/Reference.html#dimensions_reference">Dimensions Reference</a></span></dt>
106
<dt><span class="section"><a href="boost_units/Reference.html#si_system_reference">SI System Reference</a></span></dt>
107
<dt><span class="section"><a href="boost_units/Reference.html#cgs_system_reference">CGS System Reference</a></span></dt>
108
<dt><span class="section"><a href="boost_units/Reference.html#trigonometry_and_angle_system_reference">Trigonometry and Angle System Reference</a></span></dt>
109
<dt><span class="section"><a href="boost_units/Reference.html#temperature_system_reference">Temperature System Reference</a></span></dt>
110
<dt><span class="section"><a href="boost_units/Reference.html#abstract_system_reference">Abstract System Reference</a></span></dt>
111
<dt><span class="section"><a href="boost_units/Reference.html#boost_units.Reference.base_units_by_category">Base Units
112
by Category</a></span></dt>
113
<dt><span class="section"><a href="boost_units/Reference.html#boost_units.Reference.alphabetical_listing_of_base_units">Alphabetical
114
Listing of Base Units</a></span></dt>
116
<dt><span class="section"><a href="boost_units/Installation.html">Installation</a></span></dt>
117
<dt><span class="section"><a href="boost_units/FAQ.html">FAQ</a></span></dt>
119
<dt><span class="section"><a href="boost_units/FAQ.html#boost_units.FAQ.Distinguishing_Quantities_With_Same_Units">How
120
does one distinguish between quantities that are physically different but have
121
the same units (such as energy and torque)?</a></span></dt>
122
<dt><span class="section"><a href="boost_units/FAQ.html#boost_units.FAQ.Angle_Are_Units">Angles are treated as
123
units</a></span></dt>
124
<dt><span class="section"><a href="boost_units/FAQ.html#boost_units.FAQ.Why_Homogeneous_Systems">Why are there
125
homogeneous systems? Aren't heterogeneous systems sufficient?</a></span></dt>
126
<dt><span class="section"><a href="boost_units/FAQ.html#boost_units.FAQ.NoConstructorFromValueType">Why can't
127
I construct a quantity directly from the value type?</a></span></dt>
128
<dt><span class="section"><a href="boost_units/FAQ.html#boost_units.FAQ.ExplicitConversions">Why are conversions
129
explicit by default?</a></span></dt>
131
<dt><span class="section"><a href="boost_units/Acknowledgements.html">Acknowledgements</a></span></dt>
132
<dt><span class="section"><a href="boost_units/HelpWanted.html">Help Wanted</a></span></dt>
133
<dt><span class="section"><a href="boost_units/version_id.html">Version Info</a></span></dt>
134
<dt><span class="section"><a href="boost_units/ReleaseNotes.html">Release Notes</a></span></dt>
135
<dt><span class="section"><a href="boost_units/TODO.html">TODO</a></span></dt>
138
<div class="section">
139
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
140
<a name="boost_units.Introduction"></a><a class="link" href="boost_units.html#boost_units.Introduction" title="Introduction">Introduction</a>
141
</h2></div></div></div>
143
The Boost.Units library is a C++ implementation of dimensional analysis in
144
a general and extensible manner, treating it as a generic compile-time metaprogramming
145
problem. With appropriate compiler optimization, no runtime execution cost
146
is introduced, facilitating the use of this library to provide dimension checking
147
in performance-critical code. Support for units and quantities (defined as
148
a unit and associated value) for arbitrary unit system models and arbitrary
149
value types is provided, as is a fine-grained general facility for unit conversions.
150
Complete SI and CGS unit systems are provided, along with systems for angles
151
measured in degrees, radians, gradians, and revolutions and systems for temperatures
152
measured in Kelvin, degrees Celsius and degrees Fahrenheit. The library architecture
153
has been designed with flexibility and extensibility in mind; demonstrations
154
of the ease of adding new units and unit conversions are provided in the examples.
157
In order to enable complex compile-time dimensional analysis calculations with
158
no runtime overhead, Boost.Units relies heavily on the <span class="underline"><a href="http://www.boost.org/libs/mpl/doc/index.html" target="_top">Boost Metaprogramming Library</a></span>
159
(MPL) and on template metaprogramming techniques, and is, as a consequence,
160
fairly demanding of compiler compliance to ISO standards. At present, it has
161
been successfully compiled and tested on the following compilers/platforms
164
<div class="orderedlist"><ol class="orderedlist" type="1">
165
<li class="listitem">
166
g++ 4.0.1 on Mac OSX 10.4
168
<li class="listitem">
169
Intel CC 9.1, 10.0, and 10.1 on Mac OSX 10.4
171
<li class="listitem">
172
g++ 3.4.4, 4.2.3, and 4.3.0 on Windows XP
174
<li class="listitem">
175
Microsoft Visual C++ 7.1, 8.0, and 9.0 on Windows XP
177
<li class="listitem">
178
Comeau 4.3.10.1 beta2 on Windows XP
180
<li class="listitem">
181
Metrowerks CodeWarrior 9.2 on Windows XP.
183
<li class="listitem">
184
Sun CC 5.9 on Solaris and Linux
188
The following compilers/platforms are known <span class="bold"><strong>not</strong></span>
191
<div class="orderedlist"><ol class="orderedlist" type="1">
192
<li class="listitem">
195
<li class="listitem">
196
Microsoft Visual C++ 6.0 on Windows XP
198
<li class="listitem">
199
Microsoft Visual C++ 7.0 on Windows XP
201
<li class="listitem">
202
Metrowerks CodeWarrior 8.0 on Windows XP.
204
<li class="listitem">
205
All versions of Borland.
210
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
211
<td align="left"><p><small>Last revised: February 20, 2012 at 20:51:49 GMT</small></p></td>
212
<td align="right"><div class="copyright-footer"></div></td>
215
<div class="spirit-nav">
216
<a accesskey="p" href="typeof/ackn.html"><img src="../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="libraries.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="boost_units/Quick_Start.html"><img src="../../doc/src/images/next.png" alt="Next"></a>