summaryrefslogtreecommitdiff
path: root/boost/units
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-10-30 19:57:26 (GMT)
committerAnas Nashif <anas.nashif@intel.com>2012-10-30 19:57:26 (GMT)
commit1a78a62555be32868418fe52f8e330c9d0f95d5a (patch)
treed3765a80e7d3b9640ec2e930743630cd6b9fce2b /boost/units
downloadboost-1a78a62555be32868418fe52f8e330c9d0f95d5a.zip
boost-1a78a62555be32868418fe52f8e330c9d0f95d5a.tar.gz
boost-1a78a62555be32868418fe52f8e330c9d0f95d5a.tar.bz2
Imported Upstream version 1.49.0upstream/1.49.0
Diffstat (limited to 'boost/units')
-rw-r--r--boost/units/absolute.hpp153
-rw-r--r--boost/units/base_dimension.hpp107
-rw-r--r--boost/units/base_unit.hpp128
-rw-r--r--boost/units/base_units/angle/arcminute.hpp36
-rw-r--r--boost/units/base_units/angle/arcsecond.hpp37
-rw-r--r--boost/units/base_units/angle/degree.hpp27
-rw-r--r--boost/units/base_units/angle/gradian.hpp27
-rw-r--r--boost/units/base_units/angle/radian.hpp48
-rw-r--r--boost/units/base_units/angle/revolution.hpp36
-rw-r--r--boost/units/base_units/angle/steradian.hpp48
-rw-r--r--boost/units/base_units/astronomical/astronomical_unit.hpp27
-rw-r--r--boost/units/base_units/astronomical/light_day.hpp39
-rw-r--r--boost/units/base_units/astronomical/light_hour.hpp39
-rw-r--r--boost/units/base_units/astronomical/light_minute.hpp39
-rw-r--r--boost/units/base_units/astronomical/light_second.hpp27
-rw-r--r--boost/units/base_units/astronomical/light_year.hpp39
-rw-r--r--boost/units/base_units/astronomical/parsec.hpp27
-rw-r--r--boost/units/base_units/cgs/biot.hpp31
-rw-r--r--boost/units/base_units/cgs/centimeter.hpp31
-rw-r--r--boost/units/base_units/cgs/gram.hpp49
-rw-r--r--boost/units/base_units/imperial/conversions.hpp46
-rw-r--r--boost/units/base_units/imperial/drachm.hpp39
-rw-r--r--boost/units/base_units/imperial/fluid_ounce.hpp39
-rw-r--r--boost/units/base_units/imperial/foot.hpp39
-rw-r--r--boost/units/base_units/imperial/furlong.hpp39
-rw-r--r--boost/units/base_units/imperial/gallon.hpp40
-rw-r--r--boost/units/base_units/imperial/gill.hpp40
-rw-r--r--boost/units/base_units/imperial/grain.hpp39
-rw-r--r--boost/units/base_units/imperial/hundredweight.hpp39
-rw-r--r--boost/units/base_units/imperial/inch.hpp39
-rw-r--r--boost/units/base_units/imperial/league.hpp39
-rw-r--r--boost/units/base_units/imperial/mile.hpp39
-rw-r--r--boost/units/base_units/imperial/ounce.hpp39
-rw-r--r--boost/units/base_units/imperial/pint.hpp29
-rw-r--r--boost/units/base_units/imperial/pound.hpp34
-rw-r--r--boost/units/base_units/imperial/quart.hpp40
-rw-r--r--boost/units/base_units/imperial/quarter.hpp39
-rw-r--r--boost/units/base_units/imperial/stone.hpp39
-rw-r--r--boost/units/base_units/imperial/thou.hpp39
-rw-r--r--boost/units/base_units/imperial/ton.hpp40
-rw-r--r--boost/units/base_units/imperial/yard.hpp32
-rw-r--r--boost/units/base_units/metric/angstrom.hpp37
-rw-r--r--boost/units/base_units/metric/are.hpp19
-rw-r--r--boost/units/base_units/metric/atmosphere.hpp19
-rw-r--r--boost/units/base_units/metric/bar.hpp19
-rw-r--r--boost/units/base_units/metric/barn.hpp19
-rw-r--r--boost/units/base_units/metric/day.hpp39
-rw-r--r--boost/units/base_units/metric/fermi.hpp36
-rw-r--r--boost/units/base_units/metric/hectare.hpp19
-rw-r--r--boost/units/base_units/metric/hour.hpp37
-rw-r--r--boost/units/base_units/metric/knot.hpp19
-rw-r--r--boost/units/base_units/metric/liter.hpp19
-rw-r--r--boost/units/base_units/metric/micron.hpp36
-rw-r--r--boost/units/base_units/metric/minute.hpp37
-rw-r--r--boost/units/base_units/metric/mmHg.hpp19
-rw-r--r--boost/units/base_units/metric/nautical_mile.hpp36
-rw-r--r--boost/units/base_units/metric/ton.hpp39
-rw-r--r--boost/units/base_units/metric/torr.hpp19
-rw-r--r--boost/units/base_units/metric/year.hpp38
-rw-r--r--boost/units/base_units/si/ampere.hpp48
-rw-r--r--boost/units/base_units/si/candela.hpp48
-rw-r--r--boost/units/base_units/si/kelvin.hpp48
-rw-r--r--boost/units/base_units/si/kilogram.hpp31
-rw-r--r--boost/units/base_units/si/meter.hpp50
-rw-r--r--boost/units/base_units/si/mole.hpp48
-rw-r--r--boost/units/base_units/si/second.hpp48
-rw-r--r--boost/units/base_units/temperature/celsius.hpp48
-rw-r--r--boost/units/base_units/temperature/conversions.hpp42
-rw-r--r--boost/units/base_units/temperature/fahrenheit.hpp48
-rw-r--r--boost/units/base_units/us/cup.hpp39
-rw-r--r--boost/units/base_units/us/dram.hpp39
-rw-r--r--boost/units/base_units/us/fluid_dram.hpp39
-rw-r--r--boost/units/base_units/us/fluid_ounce.hpp39
-rw-r--r--boost/units/base_units/us/foot.hpp39
-rw-r--r--boost/units/base_units/us/gallon.hpp39
-rw-r--r--boost/units/base_units/us/gill.hpp39
-rw-r--r--boost/units/base_units/us/grain.hpp39
-rw-r--r--boost/units/base_units/us/hundredweight.hpp40
-rw-r--r--boost/units/base_units/us/inch.hpp39
-rw-r--r--boost/units/base_units/us/mil.hpp39
-rw-r--r--boost/units/base_units/us/mile.hpp39
-rw-r--r--boost/units/base_units/us/minim.hpp39
-rw-r--r--boost/units/base_units/us/ounce.hpp39
-rw-r--r--boost/units/base_units/us/pint.hpp28
-rw-r--r--boost/units/base_units/us/pound.hpp32
-rw-r--r--boost/units/base_units/us/pound_force.hpp32
-rw-r--r--boost/units/base_units/us/quart.hpp39
-rw-r--r--boost/units/base_units/us/tablespoon.hpp39
-rw-r--r--boost/units/base_units/us/teaspoon.hpp39
-rw-r--r--boost/units/base_units/us/ton.hpp39
-rw-r--r--boost/units/base_units/us/yard.hpp32
-rw-r--r--boost/units/cmath.hpp676
-rw-r--r--boost/units/config.hpp105
-rw-r--r--boost/units/conversion.hpp183
-rw-r--r--boost/units/derived_dimension.hpp208
-rw-r--r--boost/units/detail/absolute_impl.hpp104
-rw-r--r--boost/units/detail/cmath_impl.hpp154
-rw-r--r--boost/units/detail/conversion_impl.hpp458
-rw-r--r--boost/units/detail/dim_impl.hpp90
-rw-r--r--boost/units/detail/dimension_impl.hpp347
-rw-r--r--boost/units/detail/dimension_list.hpp133
-rw-r--r--boost/units/detail/dimensionless_unit.hpp88
-rw-r--r--boost/units/detail/heterogeneous_conversion.hpp309
-rw-r--r--boost/units/detail/linear_algebra.hpp1060
-rw-r--r--boost/units/detail/one.hpp109
-rw-r--r--boost/units/detail/ordinal.hpp49
-rw-r--r--boost/units/detail/prevent_redefinition.hpp54
-rw-r--r--boost/units/detail/push_front_if.hpp48
-rw-r--r--boost/units/detail/push_front_or_add.hpp84
-rw-r--r--boost/units/detail/sort.hpp109
-rw-r--r--boost/units/detail/static_rational_power.hpp206
-rw-r--r--boost/units/detail/unscale.hpp234
-rw-r--r--boost/units/detail/utility.hpp104
-rw-r--r--boost/units/dim.hpp167
-rw-r--r--boost/units/dimension.hpp150
-rw-r--r--boost/units/dimensionless_quantity.hpp37
-rw-r--r--boost/units/dimensionless_type.hpp55
-rw-r--r--boost/units/dimensionless_unit.hpp37
-rw-r--r--boost/units/get_dimension.hpp54
-rw-r--r--boost/units/get_system.hpp51
-rw-r--r--boost/units/heterogeneous_system.hpp428
-rw-r--r--boost/units/homogeneous_system.hpp105
-rw-r--r--boost/units/io.hpp1067
-rw-r--r--boost/units/is_dim.hpp42
-rw-r--r--boost/units/is_dimension_list.hpp47
-rw-r--r--boost/units/is_dimensionless.hpp47
-rw-r--r--boost/units/is_dimensionless_quantity.hpp34
-rw-r--r--boost/units/is_dimensionless_unit.hpp34
-rw-r--r--boost/units/is_quantity.hpp42
-rw-r--r--boost/units/is_quantity_of_dimension.hpp42
-rw-r--r--boost/units/is_quantity_of_system.hpp42
-rw-r--r--boost/units/is_unit.hpp41
-rw-r--r--boost/units/is_unit_of_dimension.hpp46
-rw-r--r--boost/units/is_unit_of_system.hpp46
-rw-r--r--boost/units/lambda.hpp593
-rw-r--r--boost/units/limits.hpp69
-rw-r--r--boost/units/make_scaled_unit.hpp60
-rw-r--r--boost/units/make_system.hpp145
-rw-r--r--boost/units/operators.hpp164
-rw-r--r--boost/units/physical_dimensions.hpp90
-rw-r--r--boost/units/physical_dimensions/absorbed_dose.hpp30
-rw-r--r--boost/units/physical_dimensions/acceleration.hpp30
-rw-r--r--boost/units/physical_dimensions/action.hpp32
-rw-r--r--boost/units/physical_dimensions/activity.hpp28
-rw-r--r--boost/units/physical_dimensions/amount.hpp49
-rw-r--r--boost/units/physical_dimensions/angular_acceleration.hpp30
-rw-r--r--boost/units/physical_dimensions/angular_momentum.hpp34
-rw-r--r--boost/units/physical_dimensions/angular_velocity.hpp30
-rw-r--r--boost/units/physical_dimensions/area.hpp28
-rw-r--r--boost/units/physical_dimensions/capacitance.hpp34
-rw-r--r--boost/units/physical_dimensions/conductance.hpp34
-rw-r--r--boost/units/physical_dimensions/conductivity.hpp34
-rw-r--r--boost/units/physical_dimensions/current.hpp49
-rw-r--r--boost/units/physical_dimensions/dose_equivalent.hpp30
-rw-r--r--boost/units/physical_dimensions/dynamic_viscosity.hpp32
-rw-r--r--boost/units/physical_dimensions/electric_charge.hpp30
-rw-r--r--boost/units/physical_dimensions/electric_potential.hpp34
-rw-r--r--boost/units/physical_dimensions/energy.hpp32
-rw-r--r--boost/units/physical_dimensions/energy_density.hpp32
-rw-r--r--boost/units/physical_dimensions/force.hpp32
-rw-r--r--boost/units/physical_dimensions/frequency.hpp28
-rw-r--r--boost/units/physical_dimensions/heat_capacity.hpp34
-rw-r--r--boost/units/physical_dimensions/illuminance.hpp32
-rw-r--r--boost/units/physical_dimensions/impedance.hpp34
-rw-r--r--boost/units/physical_dimensions/inductance.hpp34
-rw-r--r--boost/units/physical_dimensions/kinematic_viscosity.hpp30
-rw-r--r--boost/units/physical_dimensions/length.hpp49
-rw-r--r--boost/units/physical_dimensions/luminance.hpp30
-rw-r--r--boost/units/physical_dimensions/luminous_flux.hpp30
-rw-r--r--boost/units/physical_dimensions/luminous_intensity.hpp49
-rw-r--r--boost/units/physical_dimensions/magnetic_field_intensity.hpp30
-rw-r--r--boost/units/physical_dimensions/magnetic_flux.hpp34
-rw-r--r--boost/units/physical_dimensions/magnetic_flux_density.hpp32
-rw-r--r--boost/units/physical_dimensions/mass.hpp49
-rw-r--r--boost/units/physical_dimensions/mass_density.hpp30
-rw-r--r--boost/units/physical_dimensions/molar_energy.hpp34
-rw-r--r--boost/units/physical_dimensions/molar_heat_capacity.hpp36
-rw-r--r--boost/units/physical_dimensions/moment_of_inertia.hpp32
-rw-r--r--boost/units/physical_dimensions/momentum.hpp32
-rw-r--r--boost/units/physical_dimensions/permeability.hpp34
-rw-r--r--boost/units/physical_dimensions/permittivity.hpp34
-rw-r--r--boost/units/physical_dimensions/plane_angle.hpp49
-rw-r--r--boost/units/physical_dimensions/power.hpp32
-rw-r--r--boost/units/physical_dimensions/pressure.hpp32
-rw-r--r--boost/units/physical_dimensions/reluctance.hpp34
-rw-r--r--boost/units/physical_dimensions/resistance.hpp34
-rw-r--r--boost/units/physical_dimensions/resistivity.hpp34
-rw-r--r--boost/units/physical_dimensions/solid_angle.hpp49
-rw-r--r--boost/units/physical_dimensions/specific_energy.hpp30
-rw-r--r--boost/units/physical_dimensions/specific_heat_capacity.hpp32
-rw-r--r--boost/units/physical_dimensions/specific_volume.hpp30
-rw-r--r--boost/units/physical_dimensions/stress.hpp32
-rw-r--r--boost/units/physical_dimensions/surface_density.hpp30
-rw-r--r--boost/units/physical_dimensions/surface_tension.hpp31
-rw-r--r--boost/units/physical_dimensions/temperature.hpp49
-rw-r--r--boost/units/physical_dimensions/thermal_conductivity.hpp34
-rw-r--r--boost/units/physical_dimensions/time.hpp49
-rw-r--r--boost/units/physical_dimensions/torque.hpp34
-rw-r--r--boost/units/physical_dimensions/velocity.hpp30
-rw-r--r--boost/units/physical_dimensions/volume.hpp28
-rw-r--r--boost/units/physical_dimensions/wavenumber.hpp28
-rw-r--r--boost/units/pow.hpp112
-rw-r--r--boost/units/quantity.hpp1218
-rw-r--r--boost/units/reduce_unit.hpp41
-rw-r--r--boost/units/scale.hpp143
-rw-r--r--boost/units/scaled_base_unit.hpp146
-rw-r--r--boost/units/static_constant.hpp57
-rw-r--r--boost/units/static_rational.hpp349
-rw-r--r--boost/units/systems/abstract.hpp139
-rw-r--r--boost/units/systems/angle/degrees.hpp42
-rw-r--r--boost/units/systems/angle/gradians.hpp42
-rw-r--r--boost/units/systems/angle/revolutions.hpp42
-rw-r--r--boost/units/systems/cgs.hpp44
-rw-r--r--boost/units/systems/cgs/acceleration.hpp34
-rw-r--r--boost/units/systems/cgs/area.hpp36
-rw-r--r--boost/units/systems/cgs/base.hpp46
-rw-r--r--boost/units/systems/cgs/current.hpp33
-rw-r--r--boost/units/systems/cgs/dimensionless.hpp30
-rw-r--r--boost/units/systems/cgs/dynamic_viscosity.hpp33
-rw-r--r--boost/units/systems/cgs/energy.hpp34
-rw-r--r--boost/units/systems/cgs/force.hpp34
-rw-r--r--boost/units/systems/cgs/frequency.hpp31
-rw-r--r--boost/units/systems/cgs/io.hpp50
-rw-r--r--boost/units/systems/cgs/kinematic_viscosity.hpp34
-rw-r--r--boost/units/systems/cgs/length.hpp35
-rw-r--r--boost/units/systems/cgs/mass.hpp36
-rw-r--r--boost/units/systems/cgs/mass_density.hpp31
-rw-r--r--boost/units/systems/cgs/momentum.hpp31
-rw-r--r--boost/units/systems/cgs/power.hpp31
-rw-r--r--boost/units/systems/cgs/pressure.hpp34
-rw-r--r--boost/units/systems/cgs/time.hpp33
-rw-r--r--boost/units/systems/cgs/velocity.hpp36
-rw-r--r--boost/units/systems/cgs/volume.hpp36
-rw-r--r--boost/units/systems/cgs/wavenumber.hpp38
-rw-r--r--boost/units/systems/detail/constants.hpp201
-rw-r--r--boost/units/systems/si.hpp77
-rw-r--r--boost/units/systems/si/absorbed_dose.hpp34
-rw-r--r--boost/units/systems/si/acceleration.hpp36
-rw-r--r--boost/units/systems/si/action.hpp31
-rw-r--r--boost/units/systems/si/activity.hpp34
-rw-r--r--boost/units/systems/si/amount.hpp33
-rw-r--r--boost/units/systems/si/angular_acceleration.hpp31
-rw-r--r--boost/units/systems/si/angular_momentum.hpp31
-rw-r--r--boost/units/systems/si/angular_velocity.hpp34
-rw-r--r--boost/units/systems/si/area.hpp36
-rw-r--r--boost/units/systems/si/base.hpp56
-rw-r--r--boost/units/systems/si/capacitance.hpp34
-rw-r--r--boost/units/systems/si/catalytic_activity.hpp37
-rw-r--r--boost/units/systems/si/codata/alpha_constants.hpp65
-rw-r--r--boost/units/systems/si/codata/atomic-nuclear_constants.hpp56
-rw-r--r--boost/units/systems/si/codata/deuteron_constants.hpp81
-rw-r--r--boost/units/systems/si/codata/electromagnetic_constants.hpp74
-rw-r--r--boost/units/systems/si/codata/electron_constants.hpp105
-rw-r--r--boost/units/systems/si/codata/helion_constants.hpp77
-rw-r--r--boost/units/systems/si/codata/muon_constants.hpp83
-rw-r--r--boost/units/systems/si/codata/neutron_constants.hpp83
-rw-r--r--boost/units/systems/si/codata/physico-chemical_constants.hpp78
-rw-r--r--boost/units/systems/si/codata/proton_constants.hpp97
-rw-r--r--boost/units/systems/si/codata/tau_constants.hpp71
-rw-r--r--boost/units/systems/si/codata/triton_constants.hpp79
-rw-r--r--boost/units/systems/si/codata/typedefs.hpp79
-rw-r--r--boost/units/systems/si/codata/universal_constants.hpp80
-rw-r--r--boost/units/systems/si/codata_constants.hpp19
-rw-r--r--boost/units/systems/si/conductance.hpp36
-rw-r--r--boost/units/systems/si/conductivity.hpp31
-rw-r--r--boost/units/systems/si/current.hpp33
-rw-r--r--boost/units/systems/si/dimensionless.hpp30
-rw-r--r--boost/units/systems/si/dose_equivalent.hpp34
-rw-r--r--boost/units/systems/si/dynamic_viscosity.hpp31
-rw-r--r--boost/units/systems/si/electric_charge.hpp34
-rw-r--r--boost/units/systems/si/electric_potential.hpp34
-rw-r--r--boost/units/systems/si/energy.hpp34
-rw-r--r--boost/units/systems/si/force.hpp34
-rw-r--r--boost/units/systems/si/frequency.hpp33
-rw-r--r--boost/units/systems/si/illuminance.hpp33
-rw-r--r--boost/units/systems/si/impedance.hpp31
-rw-r--r--boost/units/systems/si/inductance.hpp34
-rw-r--r--boost/units/systems/si/io.hpp88
-rw-r--r--boost/units/systems/si/kinematic_viscosity.hpp31
-rw-r--r--boost/units/systems/si/length.hpp35
-rw-r--r--boost/units/systems/si/luminous_flux.hpp34
-rw-r--r--boost/units/systems/si/luminous_intensity.hpp33
-rw-r--r--boost/units/systems/si/magnetic_field_intensity.hpp31
-rw-r--r--boost/units/systems/si/magnetic_flux.hpp34
-rw-r--r--boost/units/systems/si/magnetic_flux_density.hpp34
-rw-r--r--boost/units/systems/si/mass.hpp35
-rw-r--r--boost/units/systems/si/mass_density.hpp36
-rw-r--r--boost/units/systems/si/moment_of_inertia.hpp31
-rw-r--r--boost/units/systems/si/momentum.hpp31
-rw-r--r--boost/units/systems/si/permeability.hpp31
-rw-r--r--boost/units/systems/si/permittivity.hpp31
-rw-r--r--boost/units/systems/si/plane_angle.hpp33
-rw-r--r--boost/units/systems/si/power.hpp34
-rw-r--r--boost/units/systems/si/prefixes.hpp77
-rw-r--r--boost/units/systems/si/pressure.hpp49
-rw-r--r--boost/units/systems/si/reluctance.hpp31
-rw-r--r--boost/units/systems/si/resistance.hpp34
-rw-r--r--boost/units/systems/si/resistivity.hpp31
-rw-r--r--boost/units/systems/si/solid_angle.hpp33
-rw-r--r--boost/units/systems/si/surface_density.hpp36
-rw-r--r--boost/units/systems/si/surface_tension.hpp34
-rw-r--r--boost/units/systems/si/temperature.hpp33
-rw-r--r--boost/units/systems/si/time.hpp33
-rw-r--r--boost/units/systems/si/torque.hpp34
-rw-r--r--boost/units/systems/si/velocity.hpp36
-rw-r--r--boost/units/systems/si/volume.hpp36
-rw-r--r--boost/units/systems/si/wavenumber.hpp36
-rw-r--r--boost/units/systems/temperature/celsius.hpp40
-rw-r--r--boost/units/systems/temperature/fahrenheit.hpp40
-rw-r--r--boost/units/unit.hpp440
-rw-r--r--boost/units/units_fwd.hpp73
311 files changed, 21447 insertions, 0 deletions
diff --git a/boost/units/absolute.hpp b/boost/units/absolute.hpp
new file mode 100644
index 0000000..c035475
--- /dev/null
+++ b/boost/units/absolute.hpp
@@ -0,0 +1,153 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+///
+/// \file
+/// \brief Absolute units (points rather than vectors).
+/// \details Operations between absolute units, and relative units like temperature differences.
+///
+
+#ifndef BOOST_UNITS_ABSOLUTE_HPP
+#define BOOST_UNITS_ABSOLUTE_HPP
+
+#include <iosfwd>
+
+#include <boost/units/detail/absolute_impl.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// A wrapper to represent absolute units (points rather than vectors). Intended
+/// originally for temperatures, this class implements operators for absolute units
+/// so that addition of a relative unit to an absolute unit results in another
+/// absolute unit : absolute<T> +/- T -> absolute<T> and subtraction of one absolute
+/// unit from another results in a relative unit : absolute<T> - absolute<T> -> T.
+template<class Y>
+class absolute
+{
+ public:
+ typedef absolute<Y> this_type;
+ typedef Y value_type;
+
+ absolute() : val_() { }
+ absolute(const value_type& val) : val_(val) { }
+ absolute(const this_type& source) : val_(source.val_) { }
+
+ this_type& operator=(const this_type& source) { val_ = source.val_; return *this; }
+
+ const value_type& value() const { return val_; }
+
+ const this_type& operator+=(const value_type& val) { val_ += val; return *this; }
+ const this_type& operator-=(const value_type& val) { val_ -= val; return *this; }
+
+ private:
+ value_type val_;
+};
+
+/// add a relative value to an absolute one
+template<class Y>
+absolute<Y> operator+(const absolute<Y>& aval,const Y& rval)
+{
+ return absolute<Y>(aval.value()+rval);
+}
+
+/// add a relative value to an absolute one
+template<class Y>
+absolute<Y> operator+(const Y& rval,const absolute<Y>& aval)
+{
+ return absolute<Y>(aval.value()+rval);
+}
+
+/// subtract a relative value from an absolute one
+template<class Y>
+absolute<Y> operator-(const absolute<Y>& aval,const Y& rval)
+{
+ return absolute<Y>(aval.value()-rval);
+}
+
+/// subtracting two absolutes gives a difference
+template<class Y>
+Y operator-(const absolute<Y>& aval1,const absolute<Y>& aval2)
+{
+ return Y(aval1.value()-aval2.value());
+}
+
+/// creates a quantity from an absolute unit and a raw value
+template<class D, class S, class T>
+quantity<absolute<unit<D, S> >, T> operator*(const T& t, const absolute<unit<D, S> >&)
+{
+ return(quantity<absolute<unit<D, S> >, T>::from_value(t));
+}
+
+/// creates a quantity from an absolute unit and a raw value
+template<class D, class S, class T>
+quantity<absolute<unit<D, S> >, T> operator*(const absolute<unit<D, S> >&, const T& t)
+{
+ return(quantity<absolute<unit<D, S> >, T>::from_value(t));
+}
+
+/// Print an absolute unit
+template<class Char, class Traits, class Y>
+std::basic_ostream<Char, Traits>& operator<<(std::basic_ostream<Char, Traits>& os,const absolute<Y>& aval)
+{
+
+ os << "absolute " << aval.value();
+
+ return os;
+}
+
+} // namespace units
+
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::absolute, (class))
+
+#endif
+
+namespace boost {
+
+namespace units {
+
+/// Macro to define the offset between two absolute units.
+/// Requires the value to be in the destination units e.g
+/// @code
+/// BOOST_UNITS_DEFINE_CONVERSION_OFFSET(celsius_base_unit, fahrenheit_base_unit, double, 32.0);
+/// @endcode
+/// @c BOOST_UNITS_DEFINE_CONVERSION_FACTOR is also necessary to
+/// specify the conversion factor. Like @c BOOST_UNITS_DEFINE_CONVERSION_FACTOR
+/// this macro defines both forward and reverse conversions so
+/// defining, e.g., the conversion from celsius to fahrenheit as above will also
+/// define the inverse conversion from fahrenheit to celsius.
+#define BOOST_UNITS_DEFINE_CONVERSION_OFFSET(From, To, type_, value_) \
+ namespace boost { \
+ namespace units { \
+ template<> \
+ struct affine_conversion_helper< \
+ reduce_unit<From::unit_type>::type, \
+ reduce_unit<To::unit_type>::type> \
+ { \
+ static const bool is_defined = true; \
+ typedef type_ type; \
+ static type value() { return(value_); } \
+ }; \
+ } \
+ } \
+ void boost_units_require_semicolon()
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_ABSOLUTE_HPP
diff --git a/boost/units/base_dimension.hpp b/boost/units/base_dimension.hpp
new file mode 100644
index 0000000..a635aa6
--- /dev/null
+++ b/boost/units/base_dimension.hpp
@@ -0,0 +1,107 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+/// \file
+/// \brief base dimensions (mass, length, time...).
+/// \details base dimension definition registration.
+
+#ifndef BOOST_UNITS_BASE_DIMENSION_HPP
+#define BOOST_UNITS_BASE_DIMENSION_HPP
+
+#include <boost/units/config.hpp>
+#include <boost/units/dim.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/units_fwd.hpp>
+#include <boost/units/detail/dimension_list.hpp>
+#include <boost/units/detail/ordinal.hpp>
+#include <boost/units/detail/prevent_redefinition.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// This must be in namespace boost::units so that ADL
+/// will work with friend functions defined inline.
+/// INTERNAL ONLY
+template<long N> struct base_dimension_ordinal { };
+
+/// INTERNAL ONLY
+template<class T, long N> struct base_dimension_pair { };
+
+/// INTERNAL ONLY
+template<class T, long N>
+struct check_base_dimension {
+ enum {
+ value =
+ sizeof(boost_units_is_registered(units::base_dimension_ordinal<N>())) == sizeof(detail::yes) &&
+ sizeof(boost_units_is_registered(units::base_dimension_pair<T, N>())) != sizeof(detail::yes)
+ };
+};
+
+/// Defines a base dimension. To define a dimension you need to provide
+/// the derived class (CRTP) and a unique integer.
+/// @code
+/// struct my_dimension : boost::units::base_dimension<my_dimension, 1> {};
+/// @endcode
+/// It is designed so that you will get an error message if you try
+/// to use the same value in multiple definitions.
+template<class Derived,
+ long N
+#if !defined(BOOST_UNITS_DOXYGEN) && !defined(__BORLANDC__)
+ ,
+ class = typename detail::ordinal_has_already_been_defined<
+ check_base_dimension<Derived, N>::value
+ >::type
+#endif
+>
+class base_dimension :
+ public ordinal<N>
+{
+ public:
+ /// INTERNAL ONLY
+ typedef base_dimension this_type;
+ /// A convenience typedef. Equivalent to boost::units::derived_dimension<Derived,1>::type.
+#ifndef BOOST_UNITS_DOXYGEN
+ typedef list<dim<Derived,static_rational<1> >, dimensionless_type> dimension_type;
+#else
+ typedef detail::unspecified dimension_type;
+#endif
+ /// Provided for mpl compatability.
+ typedef Derived type;
+
+ private:
+ /// Check for C++0x. In C++0x, we have to have identical
+ /// arguments but a different return type to trigger an
+ /// error. Note that this is only needed for clang as
+ /// check_base_dimension will trigger an error earlier
+ /// for compilers with less strict name lookup.
+ /// INTERNAL ONLY
+ friend Derived*
+ check_double_register(const units::base_dimension_ordinal<N>&)
+ { return(0); }
+
+ /// Register this ordinal
+ /// INTERNAL ONLY
+ friend detail::yes
+ boost_units_is_registered(const units::base_dimension_ordinal<N>&)
+ { detail::yes result; return(result); }
+
+ /// But make sure we can identify the current instantiation!
+ /// INTERNAL ONLY
+ friend detail::yes
+ boost_units_is_registered(const units::base_dimension_pair<Derived, N>&)
+ { detail::yes result; return(result); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_BASE_DIMENSION_HPP
diff --git a/boost/units/base_unit.hpp b/boost/units/base_unit.hpp
new file mode 100644
index 0000000..94fc416
--- /dev/null
+++ b/boost/units/base_unit.hpp
@@ -0,0 +1,128 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+/// \file
+/// \brief base unit (meter, kg, sec...).
+/// \details base unit definition registration.
+
+#ifndef BOOST_UNITS_BASE_UNIT_HPP
+#define BOOST_UNITS_BASE_UNIT_HPP
+
+#include <boost/units/config.hpp>
+#include <boost/units/heterogeneous_system.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/units_fwd.hpp>
+#include <boost/units/unit.hpp>
+#include <boost/units/detail/dimension_list.hpp>
+#include <boost/units/detail/ordinal.hpp>
+#include <boost/units/detail/prevent_redefinition.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// This must be in namespace boost::units so that ADL
+/// will work with friend functions defined inline.
+/// Base dimensions and base units are independent.
+/// INTERNAL ONLY
+template<long N> struct base_unit_ordinal { };
+
+/// INTERNAL ONLY
+template<class T, long N> struct base_unit_pair { };
+
+/// INTERNAL ONLY
+template<class T, long N>
+struct check_base_unit {
+ enum {
+ value =
+ sizeof(boost_units_unit_is_registered(units::base_unit_ordinal<N>())) == sizeof(detail::yes) &&
+ sizeof(boost_units_unit_is_registered(units::base_unit_pair<T, N>())) != sizeof(detail::yes)
+ };
+};
+
+/// Defines a base unit. To define a unit you need to provide
+/// the derived class (CRTP), a dimension list and a unique integer.
+/// @code
+/// struct my_unit : boost::units::base_unit<my_unit, length_dimension, 1> {};
+/// @endcode
+/// It is designed so that you will get an error message if you try
+/// to use the same value in multiple definitions.
+template<class Derived,
+ class Dim,
+ long N
+#if !defined(BOOST_UNITS_DOXYGEN) && !defined(__BORLANDC__)
+ ,
+ class = typename detail::ordinal_has_already_been_defined<
+ check_base_unit<Derived, N>::value
+ >::type
+#endif
+>
+class base_unit :
+ public ordinal<N>
+{
+ public:
+ /// INTERNAL ONLY
+ typedef void boost_units_is_base_unit_type;
+ /// INTERNAL ONLY
+ typedef base_unit this_type;
+ /// The dimensions of this base unit.
+ typedef Dim dimension_type;
+
+ /// Provided for mpl compatability.
+ typedef Derived type;
+
+ /// The unit corresponding to this base unit.
+#ifndef BOOST_UNITS_DOXYGEN
+ typedef unit<
+ Dim,
+ heterogeneous_system<
+ heterogeneous_system_impl<
+ list<
+ heterogeneous_system_dim<Derived,static_rational<1> >,
+ dimensionless_type
+ >,
+ Dim,
+ no_scale
+ >
+ >
+ > unit_type;
+#else
+ typedef detail::unspecified unit_type;
+#endif
+
+ private:
+ /// Check for C++0x. In C++0x, we have to have identical
+ /// arguments but a different return type to trigger an
+ /// error. Note that this is only needed for clang as
+ /// check_base_unit will trigger an error earlier
+ /// for compilers with less strict name lookup.
+ /// INTERNAL ONLY
+ friend Derived*
+ check_double_register(const units::base_unit_ordinal<N>&)
+ { return(0); }
+
+ /// Register this ordinal
+ /// INTERNAL ONLY
+ friend detail::yes
+ boost_units_unit_is_registered(const units::base_unit_ordinal<N>&)
+ { detail::yes result; return(result); }
+
+ /// But make sure we can identify the current instantiation!
+ /// INTERNAL ONLY
+ friend detail::yes
+ boost_units_unit_is_registered(const units::base_unit_pair<Derived, N>&)
+ { detail::yes result; return(result); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_BASE_UNIT_HPP
diff --git a/boost/units/base_units/angle/arcminute.hpp b/boost/units/base_units/angle/arcminute.hpp
new file mode 100644
index 0000000..86bf5e0
--- /dev/null
+++ b/boost/units/base_units/angle/arcminute.hpp
@@ -0,0 +1,36 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_BASE_UNITS_ANGLE_ARCMINUTE_HPP_INCLUDED
+#define BOOST_UNIT_BASE_UNITS_ANGLE_ARCMINUTE_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/angle/degree.hpp>
+
+namespace boost {
+namespace units {
+namespace angle {
+
+typedef scaled_base_unit<degree_base_unit, scale<60, static_rational<-1> > > arcminute_base_unit;
+
+}
+
+template<>
+struct base_unit_info<angle::arcminute_base_unit> {
+ static const char* name() { return("arcminute"); }
+ static const char* symbol() { return("'"); }
+};
+
+}
+}
+
+#endif // BOOST_UNIT_BASE_UNITS_ANGLE_ARCMINUTE_HPP_INCLUDED
diff --git a/boost/units/base_units/angle/arcsecond.hpp b/boost/units/base_units/angle/arcsecond.hpp
new file mode 100644
index 0000000..8baabfa
--- /dev/null
+++ b/boost/units/base_units/angle/arcsecond.hpp
@@ -0,0 +1,37 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_ANGLE_ARCSECOND_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_ANGLE_ARCSECOND_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/angle/degree.hpp>
+
+namespace boost {
+namespace units {
+namespace angle {
+
+//typedef scaled_base_unit<degree_base_unit, scale<60, static_rational<-2> > > arcsecond_base_unit;
+typedef scaled_base_unit<degree_base_unit, scale<3600, static_rational<-1> > > arcsecond_base_unit;
+
+}
+
+template<>
+struct base_unit_info<angle::arcsecond_base_unit> {
+ static const char* name() { return("arcsecond"); }
+ static const char* symbol() { return("\""); }
+};
+
+}
+}
+
+#endif // BOOST_UNIT_SYSTEMS_ANGLE_ARCSECOND_HPP_INCLUDED
diff --git a/boost/units/base_units/angle/degree.hpp b/boost/units/base_units/angle/degree.hpp
new file mode 100644
index 0000000..63edb70
--- /dev/null
+++ b/boost/units/base_units/angle/degree.hpp
@@ -0,0 +1,27 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_ANGLE_DEGREE_BASE_UNIT_HPP
+#define BOOST_UNITS_ANGLE_DEGREE_BASE_UNIT_HPP
+
+#include <boost/units/conversion.hpp>
+#include <boost/units/base_units/angle/radian.hpp>
+
+BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(angle,degree,"degree","deg",6.28318530718/360.,boost::units::angle::radian_base_unit,-101);
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::angle::degree_base_unit)
+
+#endif
+
+#endif // BOOST_UNITS_ANGLE_DEGREE_BASE_UNIT_HPP
diff --git a/boost/units/base_units/angle/gradian.hpp b/boost/units/base_units/angle/gradian.hpp
new file mode 100644
index 0000000..7b291b4
--- /dev/null
+++ b/boost/units/base_units/angle/gradian.hpp
@@ -0,0 +1,27 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_ANGLE_GRADIAN_BASE_UNIT_HPP
+#define BOOST_UNITS_ANGLE_GRADIAN_BASE_UNIT_HPP
+
+#include <boost/units/conversion.hpp>
+#include <boost/units/base_units/angle/radian.hpp>
+
+BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(angle,gradian,"gradian","grad",6.28318530718/400.,boost::units::angle::radian_base_unit,-102);
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::angle::gradian_base_unit)
+
+#endif
+
+#endif // BOOST_UNITS_ANGLE_GRADIAN_BASE_UNIT_HPP
diff --git a/boost/units/base_units/angle/radian.hpp b/boost/units/base_units/angle/radian.hpp
new file mode 100644
index 0000000..f2b5667
--- /dev/null
+++ b/boost/units/base_units/angle/radian.hpp
@@ -0,0 +1,48 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_ANGLE_RADIAN_BASE_UNIT_HPP
+#define BOOST_UNITS_ANGLE_RADIAN_BASE_UNIT_HPP
+
+#include <string>
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_unit.hpp>
+#include <boost/units/physical_dimensions/plane_angle.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace angle {
+
+struct radian_base_unit : public base_unit<radian_base_unit, plane_angle_dimension, -2>
+{
+ static std::string name() { return("radian"); }
+ static std::string symbol() { return("rad"); }
+};
+
+} // namespace angle
+
+} // namespace units
+
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::angle::radian_base_unit)
+
+#endif
+
+//#include <boost/units/base_units/angle/conversions.hpp>
+
+#endif // BOOST_UNITS_ANGLE_RADIAN_BASE_UNIT_HPP
diff --git a/boost/units/base_units/angle/revolution.hpp b/boost/units/base_units/angle/revolution.hpp
new file mode 100644
index 0000000..2dd0d5b
--- /dev/null
+++ b/boost/units/base_units/angle/revolution.hpp
@@ -0,0 +1,36 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_BASE_UNITS_REVOLUTION_HPP
+#define BOOST_UNITS_BASE_UNITS_REVOLUTION_HPP
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/angle/degree.hpp>
+
+namespace boost {
+namespace units {
+namespace angle {
+
+typedef scaled_base_unit<degree_base_unit, scale<360, static_rational<1> > > revolution_base_unit;
+
+}
+
+template<>
+struct base_unit_info<angle::revolution_base_unit> {
+ static const char* name() { return("revolution"); }
+ static const char* symbol() { return("rev"); }
+};
+
+}
+}
+
+#endif // BOOST_UNITS_BASE_UNITS_REVOLUTION_HPP
diff --git a/boost/units/base_units/angle/steradian.hpp b/boost/units/base_units/angle/steradian.hpp
new file mode 100644
index 0000000..5e8c5bd
--- /dev/null
+++ b/boost/units/base_units/angle/steradian.hpp
@@ -0,0 +1,48 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_ANGLE_STERADIAN_BASE_UNIT_HPP
+#define BOOST_UNITS_ANGLE_STERADIAN_BASE_UNIT_HPP
+
+#include <string>
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_unit.hpp>
+#include <boost/units/physical_dimensions/solid_angle.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace angle {
+
+struct steradian_base_unit : public base_unit<steradian_base_unit, solid_angle_dimension, -1>
+{
+ static std::string name() { return("steradian"); }
+ static std::string symbol() { return("sr"); }
+};
+
+} // namespace angle
+
+} // namespace units
+
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::angle::steradian_base_unit)
+
+#endif
+
+//#include <boost/units/base_units/angle/conversions.hpp>
+
+#endif // BOOST_UNITS_ANGLE_STERADIAN_BASE_UNIT_HPP
diff --git a/boost/units/base_units/astronomical/astronomical_unit.hpp b/boost/units/base_units/astronomical/astronomical_unit.hpp
new file mode 100644
index 0000000..4b1640d
--- /dev/null
+++ b/boost/units/base_units/astronomical/astronomical_unit.hpp
@@ -0,0 +1,27 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_ASTRONOMICAL_ASTRONOMICAL_UNIT_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_ASTRONOMICAL_ASTRONOMICAL_UNIT_HPP_INCLUDED
+
+#include <boost/units/conversion.hpp>
+#include <boost/units/base_units/si/meter.hpp>
+
+BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(astronomical, astronomical_unit, "astronomical unit", "a.u.", 149597870691.0, boost::units::si::meter_base_unit, -207);
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::astronomical::astronomical_unit_base_unit)
+
+#endif
+
+#endif // BOOST_UNIT_SYSTEMS_ASTRONOMICAL_ASTRONOMICAL_UNIT_HPP_INCLUDED
diff --git a/boost/units/base_units/astronomical/light_day.hpp b/boost/units/base_units/astronomical/light_day.hpp
new file mode 100644
index 0000000..2d045ff
--- /dev/null
+++ b/boost/units/base_units/astronomical/light_day.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_DAY_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_DAY_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/astronomical/light_second.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace astronomical {
+
+typedef scaled_base_unit<boost::units::astronomical::light_second_base_unit, scale<86400, static_rational<1> > > light_day_base_unit;
+
+} // namespace astronomical
+
+template<>
+struct base_unit_info<astronomical::light_day_base_unit> {
+ static const char* name() { return("light day"); }
+ static const char* symbol() { return("ldy"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_DAY_HPP_INCLUDED
diff --git a/boost/units/base_units/astronomical/light_hour.hpp b/boost/units/base_units/astronomical/light_hour.hpp
new file mode 100644
index 0000000..207d951
--- /dev/null
+++ b/boost/units/base_units/astronomical/light_hour.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_HOUR_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_HOUR_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/astronomical/light_second.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace astronomical {
+
+typedef scaled_base_unit<boost::units::astronomical::light_second_base_unit, scale<3600, static_rational<1> > > light_hour_base_unit;
+
+} // namespace astronomical
+
+template<>
+struct base_unit_info<astronomical::light_hour_base_unit> {
+ static const char* name() { return("light hour"); }
+ static const char* symbol() { return("lhr"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_HOUR_HPP_INCLUDED
diff --git a/boost/units/base_units/astronomical/light_minute.hpp b/boost/units/base_units/astronomical/light_minute.hpp
new file mode 100644
index 0000000..f0bd095
--- /dev/null
+++ b/boost/units/base_units/astronomical/light_minute.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_MINUTE_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_MINUTE_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/astronomical/light_second.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace astronomical {
+
+typedef scaled_base_unit<boost::units::astronomical::light_second_base_unit, scale<60, static_rational<1> > > light_minute_base_unit;
+
+} // namespace astronomical
+
+template<>
+struct base_unit_info<astronomical::light_minute_base_unit> {
+ static const char* name() { return("light minute"); }
+ static const char* symbol() { return("lmn"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_MINUTE_HPP_INCLUDED
diff --git a/boost/units/base_units/astronomical/light_second.hpp b/boost/units/base_units/astronomical/light_second.hpp
new file mode 100644
index 0000000..555a315
--- /dev/null
+++ b/boost/units/base_units/astronomical/light_second.hpp
@@ -0,0 +1,27 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_SECOND_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_SECOND_HPP_INCLUDED
+
+#include <boost/units/conversion.hpp>
+#include <boost/units/base_units/si/meter.hpp>
+
+BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(astronomical, light_second, "light second", "lsc", 2.99792458e8, boost::units::si::meter_base_unit, -201);
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::astronomical::light_second_base_unit)
+
+#endif
+
+#endif // BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_SECOND_HPP_INCLUDED
diff --git a/boost/units/base_units/astronomical/light_year.hpp b/boost/units/base_units/astronomical/light_year.hpp
new file mode 100644
index 0000000..e9e83a3
--- /dev/null
+++ b/boost/units/base_units/astronomical/light_year.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_YEAR_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_YEAR_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/astronomical/light_second.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace astronomical {
+
+typedef scaled_base_unit<boost::units::astronomical::light_second_base_unit, scale<31557600, static_rational<1> > > light_year_base_unit;
+
+} // namespace astronomical
+
+template<>
+struct base_unit_info<astronomical::light_year_base_unit> {
+ static const char* name() { return("light year"); }
+ static const char* symbol() { return("ly"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_YEAR_HPP_INCLUDED
diff --git a/boost/units/base_units/astronomical/parsec.hpp b/boost/units/base_units/astronomical/parsec.hpp
new file mode 100644
index 0000000..dd116e5
--- /dev/null
+++ b/boost/units/base_units/astronomical/parsec.hpp
@@ -0,0 +1,27 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_ASTRONOMICAL_PARSEC_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_ASTRONOMICAL_PARSEC_HPP_INCLUDED
+
+#include <boost/units/conversion.hpp>
+#include <boost/units/base_units/si/meter.hpp>
+
+BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(astronomical, parsec, "parsec", "psc", 3.0856775813e16, boost::units::si::meter_base_unit, -206);
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::astronomical::parsec_base_unit)
+
+#endif
+
+#endif // BOOST_UNIT_SYSTEMS_ASTRONOMICAL_PARSEC_HPP_INCLUDED
diff --git a/boost/units/base_units/cgs/biot.hpp b/boost/units/base_units/cgs/biot.hpp
new file mode 100644
index 0000000..51eb5fc
--- /dev/null
+++ b/boost/units/base_units/cgs/biot.hpp
@@ -0,0 +1,31 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_CGS_BIOT_BASE_UNIT_HPP
+#define BOOST_UNITS_CGS_BIOT_BASE_UNIT_HPP
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/base_units/si/ampere.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace cgs {
+
+typedef scaled_base_unit<boost::units::si::ampere_base_unit, scale<10, static_rational<-1> > > biot_base_unit;
+
+} // namespace cgs
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_CGS_BIOT_BASE_UNIT_HPP
diff --git a/boost/units/base_units/cgs/centimeter.hpp b/boost/units/base_units/cgs/centimeter.hpp
new file mode 100644
index 0000000..1ff712e
--- /dev/null
+++ b/boost/units/base_units/cgs/centimeter.hpp
@@ -0,0 +1,31 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_CENTIMETER_BASE_UNIT_HPP
+#define BOOST_UNITS_CENTIMETER_BASE_UNIT_HPP
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/base_units/si/meter.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace cgs {
+
+typedef scaled_base_unit<boost::units::si::meter_base_unit, scale<10, static_rational<-2> > > centimeter_base_unit;
+
+} // namespace cgs
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_CENTIMETER_BASE_UNIT_HPP
diff --git a/boost/units/base_units/cgs/gram.hpp b/boost/units/base_units/cgs/gram.hpp
new file mode 100644
index 0000000..1c2cc18
--- /dev/null
+++ b/boost/units/base_units/cgs/gram.hpp
@@ -0,0 +1,49 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_CGS_GRAM_BASE_UNIT_HPP
+#define BOOST_UNITS_CGS_GRAM_BASE_UNIT_HPP
+
+#include <string>
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_unit.hpp>
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace cgs {
+
+struct gram_base_unit : public base_unit<gram_base_unit, mass_dimension, -8>
+{
+ static std::string name() { return("gram"); }
+ static std::string symbol() { return("g"); }
+};
+
+} // namespace cgs
+
+} // namespace units
+
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::cgs::gram_base_unit)
+
+#endif
+
+//#include <boost/units/base_units/detail/conversions.hpp>
+
+#endif // BOOST_UNITS_CGS_GRAM_BASE_UNIT_HPP
diff --git a/boost/units/base_units/imperial/conversions.hpp b/boost/units/base_units/imperial/conversions.hpp
new file mode 100644
index 0000000..54cf638
--- /dev/null
+++ b/boost/units/base_units/imperial/conversions.hpp
@@ -0,0 +1,46 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// No include guards. This header is intended to be included
+// multiple times.
+
+// imperial units
+
+#if 0
+
+#if defined(BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_HPP_INCLUDED) && defined(BOOST_UNITS_BASE_UNITS_IMPERIAL_GALLON_HPP_INCLUDED) &&\
+ !defined(BOOST_BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_TO_GALLON_CONVERSION_DEFINED)
+ #define BOOST_BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_TO_GALLON_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::imperial::pint_base_unit,boost::units::imperial::gallon_base_unit, double, 1./8.);
+#endif
+
+#if defined(BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_HPP_INCLUDED) && defined(BOOST_UNITS_BASE_UNITS_IMPERIAL_QUART_HPP_INCLUDED) &&\
+ !defined(BOOST_BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_TO_QUART_CONVERSION_DEFINED)
+ #define BOOST_BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_TO_QUART_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::imperial::pint_base_unit,boost::units::imperial::quart_base_unit, double, 1./2.);
+#endif
+
+#if defined(BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_HPP_INCLUDED) && defined(BOOST_UNITS_BASE_UNITS_IMPERIAL_GILL_HPP_INCLUDED) &&\
+ !defined(BOOST_BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_TO_GILL_CONVERSION_DEFINED)
+ #define BOOST_BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_TO_GILL_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::imperial::pint_base_unit,boost::units::imperial::gill_base_unit, double, 4.);
+#endif
+
+#if defined(BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_HPP_INCLUDED) && defined(BOOST_UNITS_BASE_UNITS_IMPERIAL_FLUID_OUNCE_HPP_INCLUDED) &&\
+ !defined(BOOST_BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_TO_FLUID_OUNCE_CONVERSION_DEFINED)
+ #define BOOST_BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_TO_FLUID_OUNCE_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::imperial::pint_base_unit,boost::units::imperial::fluid_ounce_base_unit, double, 20.);
+#endif
+
+#endif
diff --git a/boost/units/base_units/imperial/drachm.hpp b/boost/units/base_units/imperial/drachm.hpp
new file mode 100644
index 0000000..3dcc024
--- /dev/null
+++ b/boost/units/base_units/imperial/drachm.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_IMPERIAL_DRACHM_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_IMPERIAL_DRACHM_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/imperial/pound.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace imperial {
+
+typedef scaled_base_unit<pound_base_unit, scale<16, static_rational<-2> > > drachm_base_unit;
+
+} // namespace imperial
+
+template<>
+struct base_unit_info<imperial::drachm_base_unit> {
+ static const char* name() { return("drachm"); }
+ static const char* symbol() { return("drachm"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNIT_SYSTEMS_IMPERIAL_DRACHM_HPP_INCLUDED
diff --git a/boost/units/base_units/imperial/fluid_ounce.hpp b/boost/units/base_units/imperial/fluid_ounce.hpp
new file mode 100644
index 0000000..8bab33e
--- /dev/null
+++ b/boost/units/base_units/imperial/fluid_ounce.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_BASE_UNITS_IMPERIAL_FLUID_OUNCE_HPP_INCLUDED
+#define BOOST_UNITS_BASE_UNITS_IMPERIAL_FLUID_OUNCE_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/imperial/pint.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace imperial {
+
+typedef scaled_base_unit<pint_base_unit, scale<20, static_rational<-1> > > fluid_ounce_base_unit;
+
+} // namespace imperial
+
+template<>
+struct base_unit_info<imperial::fluid_ounce_base_unit> {
+ static const char* name() { return("fluid ounce (imp.)"); }
+ static const char* symbol() { return("fl oz"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_BASE_UNITS_IMPERIAL_FLUID_OUNCE_HPP_INCLUDED
diff --git a/boost/units/base_units/imperial/foot.hpp b/boost/units/base_units/imperial/foot.hpp
new file mode 100644
index 0000000..149985e
--- /dev/null
+++ b/boost/units/base_units/imperial/foot.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_IMPERIAL_FOOT_BASE_UNIT_HPP
+#define BOOST_UNITS_IMPERIAL_FOOT_BASE_UNIT_HPP
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/imperial/yard.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace imperial {
+
+typedef scaled_base_unit<yard_base_unit, scale<3, static_rational<-1> > > foot_base_unit;
+
+} // namespace imperial
+
+template<>
+struct base_unit_info<imperial::foot_base_unit> {
+ static const char* name() { return("foot"); }
+ static const char* symbol() { return("ft"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_IMPERIAL_FOOT_BASE_UNIT_HPP
diff --git a/boost/units/base_units/imperial/furlong.hpp b/boost/units/base_units/imperial/furlong.hpp
new file mode 100644
index 0000000..1d98821
--- /dev/null
+++ b/boost/units/base_units/imperial/furlong.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_IMPERIAL_FURLONG_BASE_UNIT_HPP
+#define BOOST_UNITS_IMPERIAL_FURLONG_BASE_UNIT_HPP
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/imperial/yard.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace imperial {
+
+typedef scaled_base_unit<yard_base_unit, scale<220, static_rational<1> > > furlong_base_unit;
+
+} // namespace imperial
+
+template<>
+struct base_unit_info<imperial::furlong_base_unit> {
+ static const char* name() { return("furlong"); }
+ static const char* symbol() { return("furlong"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_IMPERIAL_FURLONG_BASE_UNIT_HPP
diff --git a/boost/units/base_units/imperial/gallon.hpp b/boost/units/base_units/imperial/gallon.hpp
new file mode 100644
index 0000000..6fd4653
--- /dev/null
+++ b/boost/units/base_units/imperial/gallon.hpp
@@ -0,0 +1,40 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_BASE_UNITS_IMPERIAL_GALLON_HPP_INCLUDED
+#define BOOST_UNITS_BASE_UNITS_IMPERIAL_GALLON_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/imperial/pint.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace imperial {
+
+//typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<3> > > gallon_base_unit;
+typedef scaled_base_unit<pint_base_unit, scale<8, static_rational<1> > > gallon_base_unit;
+
+} // namespace imperial
+
+template<>
+struct base_unit_info<imperial::gallon_base_unit> {
+ static const char* name() { return("gallon (imp.)"); }
+ static const char* symbol() { return("gal"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_BASE_UNITS_IMPERIAL_GALLON_HPP_INCLUDED
diff --git a/boost/units/base_units/imperial/gill.hpp b/boost/units/base_units/imperial/gill.hpp
new file mode 100644
index 0000000..3e5b83a
--- /dev/null
+++ b/boost/units/base_units/imperial/gill.hpp
@@ -0,0 +1,40 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_BASE_UNITS_IMPERIAL_GILL_HPP_INCLUDED
+#define BOOST_UNITS_BASE_UNITS_IMPERIAL_GILL_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/imperial/pint.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace imperial {
+
+//typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<-2> > > gill_base_unit;
+typedef scaled_base_unit<pint_base_unit, scale<4, static_rational<-1> > > gill_base_unit;
+
+} // namespace imperial
+
+template<>
+struct base_unit_info<imperial::gill_base_unit> {
+ static const char* name() { return("gill (imp.)"); }
+ static const char* symbol() { return("gill"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_BASE_UNITS_IMPERIAL_GILL_HPP_INCLUDED
diff --git a/boost/units/base_units/imperial/grain.hpp b/boost/units/base_units/imperial/grain.hpp
new file mode 100644
index 0000000..a36b4a4
--- /dev/null
+++ b/boost/units/base_units/imperial/grain.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_IMPERIAL_GRAIN_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_IMPERIAL_GRAIN_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/imperial/pound.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace imperial {
+
+typedef scaled_base_unit<pound_base_unit, scale<7000, static_rational<-1> > > grain_base_unit;
+
+} // namespace imperial
+
+template<>
+struct base_unit_info<imperial::grain_base_unit> {
+ static const char* name() { return("grain"); }
+ static const char* symbol() { return("grain"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNIT_SYSTEMS_IMPERIAL_GRAIN_HPP_INCLUDED
diff --git a/boost/units/base_units/imperial/hundredweight.hpp b/boost/units/base_units/imperial/hundredweight.hpp
new file mode 100644
index 0000000..6709a78
--- /dev/null
+++ b/boost/units/base_units/imperial/hundredweight.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_IMPERIAL_HUNDREDWEIGHT_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_IMPERIAL_HUNDREDWEIGHT_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/imperial/pound.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace imperial {
+
+typedef scaled_base_unit<pound_base_unit, scale<112, static_rational<1> > > hundredweight_base_unit;
+
+} // namespace imperial
+
+template<>
+struct base_unit_info<imperial::hundredweight_base_unit> {
+ static const char* name() { return("hundredweight"); }
+ static const char* symbol() { return("cwt"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNIT_SYSTEMS_IMPERIAL_HUNDREDWEIGHT_HPP_INCLUDED
diff --git a/boost/units/base_units/imperial/inch.hpp b/boost/units/base_units/imperial/inch.hpp
new file mode 100644
index 0000000..048d8c6
--- /dev/null
+++ b/boost/units/base_units/imperial/inch.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_IMPERIAL_INCH_BASE_UNIT_HPP
+#define BOOST_UNITS_IMPERIAL_INCH_BASE_UNIT_HPP
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/imperial/yard.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace imperial {
+
+typedef scaled_base_unit<yard_base_unit, scale<36, static_rational<-1> > > inch_base_unit;
+
+} // namespace imperial
+
+template<>
+struct base_unit_info<imperial::inch_base_unit> {
+ static const char* name() { return("inch"); }
+ static const char* symbol() { return("in"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_IMPERIAL_INCH_BASE_UNIT_HPP
diff --git a/boost/units/base_units/imperial/league.hpp b/boost/units/base_units/imperial/league.hpp
new file mode 100644
index 0000000..991e4b6
--- /dev/null
+++ b/boost/units/base_units/imperial/league.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_IMPERIAL_LEAGUE_BASE_UNIT_HPP
+#define BOOST_UNITS_IMPERIAL_LEAGUE_BASE_UNIT_HPP
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/imperial/yard.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace imperial {
+
+typedef scaled_base_unit<yard_base_unit, scale<5280, static_rational<1> > > league_base_unit;
+
+} // namespace imperial
+
+template<>
+struct base_unit_info<imperial::league_base_unit> {
+ static const char* name() { return("league"); }
+ static const char* symbol() { return("league"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_IMPERIAL_LEAGUE_BASE_UNIT_HPP
diff --git a/boost/units/base_units/imperial/mile.hpp b/boost/units/base_units/imperial/mile.hpp
new file mode 100644
index 0000000..d0d0fb5
--- /dev/null
+++ b/boost/units/base_units/imperial/mile.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_IMPERIAL_MILE_BASE_UNIT_HPP
+#define BOOST_UNITS_IMPERIAL_MILE_BASE_UNIT_HPP
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/imperial/yard.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace imperial {
+
+typedef scaled_base_unit<yard_base_unit, scale<1760, static_rational<1> > > mile_base_unit;
+
+} // namespace imperial
+
+template<>
+struct base_unit_info<imperial::mile_base_unit> {
+ static const char* name() { return("mile"); }
+ static const char* symbol() { return("mi"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_IMPERIAL_MILE_BASE_UNIT_HPP
diff --git a/boost/units/base_units/imperial/ounce.hpp b/boost/units/base_units/imperial/ounce.hpp
new file mode 100644
index 0000000..8b9e33a
--- /dev/null
+++ b/boost/units/base_units/imperial/ounce.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_IMPERIAL_OUNCE_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_IMPERIAL_OUNCE_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/imperial/pound.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace imperial {
+
+typedef scaled_base_unit<pound_base_unit, scale<2, static_rational<-4> > > ounce_base_unit;
+
+} // namespace imperial
+
+template<>
+struct base_unit_info<imperial::ounce_base_unit> {
+ static const char* name() { return("ounce"); }
+ static const char* symbol() { return("oz"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNIT_SYSTEMS_IMPERIAL_OUNCE_HPP_INCLUDED
diff --git a/boost/units/base_units/imperial/pint.hpp b/boost/units/base_units/imperial/pint.hpp
new file mode 100644
index 0000000..1a1440f
--- /dev/null
+++ b/boost/units/base_units/imperial/pint.hpp
@@ -0,0 +1,29 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_HPP_INCLUDED
+#define BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_HPP_INCLUDED
+
+#include <string>
+
+#include <boost/units/systems/si/volume.hpp>
+#include <boost/units/conversion.hpp>
+
+BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(imperial, pint, "pint (imp.)", "pt", 4.54609e-3/8., si::volume, -303); // exact conversion
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::imperial::pint_base_unit)
+
+#endif
+
+#endif // BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_HPP_INCLUDED
diff --git a/boost/units/base_units/imperial/pound.hpp b/boost/units/base_units/imperial/pound.hpp
new file mode 100644
index 0000000..c586e6d
--- /dev/null
+++ b/boost/units/base_units/imperial/pound.hpp
@@ -0,0 +1,34 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_IMPERIAL_POUND_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_IMPERIAL_POUND_HPP_INCLUDED
+
+#include <string>
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_unit.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/base_units/cgs/gram.hpp>
+#include <boost/units/conversion.hpp>
+
+// can't define in terms of kilogram because it is a scaled_base_unit
+//BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(imperial, pound, "pound", "lb", 0.45359237, si::kilogram_base_unit, -302); // exact conversion
+BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(imperial, pound, "pound", "lb", 453.59237, cgs::gram_base_unit, -302); // exact conversion
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::imperial::pound_base_unit)
+
+#endif
+
+#endif // BOOST_UNIT_SYSTEMS_IMPERIAL_POUND_HPP_INCLUDED
diff --git a/boost/units/base_units/imperial/quart.hpp b/boost/units/base_units/imperial/quart.hpp
new file mode 100644
index 0000000..723ce0b
--- /dev/null
+++ b/boost/units/base_units/imperial/quart.hpp
@@ -0,0 +1,40 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_BASE_UNITS_IMPERIAL_QUART_HPP_INCLUDED
+#define BOOST_UNITS_BASE_UNITS_IMPERIAL_QUART_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/imperial/pint.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace imperial {
+
+//typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<1> > > quart_base_unit;
+typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<1> > > quart_base_unit;
+
+} // namespace imperial
+
+template<>
+struct base_unit_info<imperial::quart_base_unit> {
+ static const char* name() { return("quart (imp.)"); }
+ static const char* symbol() { return("qt"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_BASE_UNITS_IMPERIAL_QUART_HPP_INCLUDED
diff --git a/boost/units/base_units/imperial/quarter.hpp b/boost/units/base_units/imperial/quarter.hpp
new file mode 100644
index 0000000..30f0594
--- /dev/null
+++ b/boost/units/base_units/imperial/quarter.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_IMPERIAL_QUARTER_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_IMPERIAL_QUARTER_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/imperial/pound.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace imperial {
+
+typedef scaled_base_unit<pound_base_unit, scale<28, static_rational<1> > > quarter_base_unit;
+
+} // namespace imperial
+
+template<>
+struct base_unit_info<imperial::quarter_base_unit> {
+ static const char* name() { return("quarter"); }
+ static const char* symbol() { return("quarter"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNIT_SYSTEMS_IMPERIAL_QUARTER_HPP_INCLUDED
diff --git a/boost/units/base_units/imperial/stone.hpp b/boost/units/base_units/imperial/stone.hpp
new file mode 100644
index 0000000..b4ce433
--- /dev/null
+++ b/boost/units/base_units/imperial/stone.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_IMPERIAL_STONE_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_IMPERIAL_STONE_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/imperial/pound.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace imperial {
+
+typedef scaled_base_unit<pound_base_unit, scale<14, static_rational<1> > > stone_base_unit;
+
+} // namespace imperial
+
+template<>
+struct base_unit_info<imperial::stone_base_unit> {
+ static const char* name() { return("stone"); }
+ static const char* symbol() { return("st"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNIT_SYSTEMS_IMPERIAL_STONE_HPP_INCLUDED
diff --git a/boost/units/base_units/imperial/thou.hpp b/boost/units/base_units/imperial/thou.hpp
new file mode 100644
index 0000000..eab2ac9
--- /dev/null
+++ b/boost/units/base_units/imperial/thou.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_IMPERIAL_THOU_BASE_UNIT_HPP
+#define BOOST_UNITS_IMPERIAL_THOU_BASE_UNIT_HPP
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/imperial/yard.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace imperial {
+
+typedef scaled_base_unit<yard_base_unit, scale<36000, static_rational<-1> > > thou_base_unit;
+
+} // namespace imperial
+
+template<>
+struct base_unit_info<imperial::thou_base_unit> {
+ static const char* name() { return("thou"); }
+ static const char* symbol() { return("thou"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_IMPERIAL_THOU_BASE_UNIT_HPP
diff --git a/boost/units/base_units/imperial/ton.hpp b/boost/units/base_units/imperial/ton.hpp
new file mode 100644
index 0000000..867f147
--- /dev/null
+++ b/boost/units/base_units/imperial/ton.hpp
@@ -0,0 +1,40 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_IMPERIAL_TON_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_IMPERIAL_TON_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/imperial/pound.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace imperial {
+
+typedef scaled_base_unit<pound_base_unit, scale<2240, static_rational<1> > > ton_base_unit;
+
+} // namespace imperial
+
+template<>
+struct base_unit_info<imperial::ton_base_unit> {
+ static const char* name() { return("long ton"); }
+ static const char* symbol() { return("t"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNIT_SYSTEMS_IMPERIAL_TON_HPP_INCLUDED
+
diff --git a/boost/units/base_units/imperial/yard.hpp b/boost/units/base_units/imperial/yard.hpp
new file mode 100644
index 0000000..d15b99d
--- /dev/null
+++ b/boost/units/base_units/imperial/yard.hpp
@@ -0,0 +1,32 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_SYSTEMS_IMPERIAL_YARD_BASE_UNIT_HPP
+#define BOOST_UNITS_SYSTEMS_IMPERIAL_YARD_BASE_UNIT_HPP
+
+#include <string>
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_unit.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/base_units/si/meter.hpp>
+#include <boost/units/conversion.hpp>
+
+BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(imperial, yard, "yard", "yd", 0.9144, si::meter_base_unit, -301); // exact conversion
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::imperial::yard_base_unit)
+
+#endif
+
+#endif // BOOST_UNITS_SYSTEMS_IMPERIAL_YARD_BASE_UNIT_HPP
diff --git a/boost/units/base_units/metric/angstrom.hpp b/boost/units/base_units/metric/angstrom.hpp
new file mode 100644
index 0000000..d2954e3
--- /dev/null
+++ b/boost/units/base_units/metric/angstrom.hpp
@@ -0,0 +1,37 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_METRIC_ANGSTROM_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_METRIC_ANGSTROM_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/units_fwd.hpp>
+#include <boost/units/base_units/si/meter.hpp>
+
+namespace boost {
+namespace units {
+namespace metric {
+
+typedef scaled_base_unit<boost::units::si::meter_base_unit, scale<10, static_rational<-10> > > angstrom_base_unit;
+
+}
+
+template<>
+struct base_unit_info<metric::angstrom_base_unit> {
+ static const char* name() { return("angstrom"); }
+ static const char* symbol() { return("A"); }
+};
+
+}
+}
+
+#endif // BOOST_UNIT_SYSTEMS_METRIC_ANGSTROM_HPP_INCLUDED
diff --git a/boost/units/base_units/metric/are.hpp b/boost/units/base_units/metric/are.hpp
new file mode 100644
index 0000000..bd697f4
--- /dev/null
+++ b/boost/units/base_units/metric/are.hpp
@@ -0,0 +1,19 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_METRIC_ARE_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_METRIC_ARE_HPP_INCLUDED
+
+#include <boost/units/conversion.hpp>
+#include <boost/units/systems/si/area.hpp>
+
+BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, are, "are", "a", 1.0e2, si::area, 10);
+
+#endif // BOOST_UNIT_SYSTEMS_METRIC_ARE_HPP_INCLUDED
diff --git a/boost/units/base_units/metric/atmosphere.hpp b/boost/units/base_units/metric/atmosphere.hpp
new file mode 100644
index 0000000..b714e90
--- /dev/null
+++ b/boost/units/base_units/metric/atmosphere.hpp
@@ -0,0 +1,19 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_METRIC_ATMOSPHERE_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_METRIC_ATMOSPHERE_HPP_INCLUDED
+
+#include <boost/units/conversion.hpp>
+#include <boost/units/systems/si/pressure.hpp>
+
+BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, atmosphere, "atmosphere", "atm", 1.01325e5, si::pressure, 33);
+
+#endif // BOOST_UNIT_SYSTEMS_METRIC_ATMOSPHERE_HPP_INCLUDED
diff --git a/boost/units/base_units/metric/bar.hpp b/boost/units/base_units/metric/bar.hpp
new file mode 100644
index 0000000..682d54f
--- /dev/null
+++ b/boost/units/base_units/metric/bar.hpp
@@ -0,0 +1,19 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_METRIC_BAR_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_METRIC_BAR_HPP_INCLUDED
+
+#include <boost/units/conversion.hpp>
+#include <boost/units/systems/si/pressure.hpp>
+
+BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, bar, "bar", "bar", 1.0e5, si::pressure, 14);
+
+#endif // BOOST_UNIT_SYSTEMS_METRIC_BAR_HPP_INCLUDED
diff --git a/boost/units/base_units/metric/barn.hpp b/boost/units/base_units/metric/barn.hpp
new file mode 100644
index 0000000..ae2b28c
--- /dev/null
+++ b/boost/units/base_units/metric/barn.hpp
@@ -0,0 +1,19 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_METRIC_BARN_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_METRIC_BARN_HPP_INCLUDED
+
+#include <boost/units/conversion.hpp>
+#include <boost/units/systems/si/area.hpp>
+
+BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, barn, "barn", "b", 1.0e-28, si::area, 11);
+
+#endif // BOOST_UNIT_SYSTEMS_METRIC_BARN_HPP_INCLUDED
diff --git a/boost/units/base_units/metric/day.hpp b/boost/units/base_units/metric/day.hpp
new file mode 100644
index 0000000..f8d83c8
--- /dev/null
+++ b/boost/units/base_units/metric/day.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_OTHER_DAY_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_OTHER_DAY_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/si/second.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace metric {
+
+typedef scaled_base_unit<boost::units::si::second_base_unit, scale<86400, static_rational<1> > > day_base_unit;
+
+} // namespace metric
+
+template<>
+struct base_unit_info<metric::day_base_unit> {
+ static const char* name() { return("day"); }
+ static const char* symbol() { return("d"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif
diff --git a/boost/units/base_units/metric/fermi.hpp b/boost/units/base_units/metric/fermi.hpp
new file mode 100644
index 0000000..8732c4e
--- /dev/null
+++ b/boost/units/base_units/metric/fermi.hpp
@@ -0,0 +1,36 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_METRIC_FERMI_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_METRIC_FERMI_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/si/meter.hpp>
+
+namespace boost {
+namespace units {
+namespace metric {
+
+typedef scaled_base_unit<boost::units::si::meter_base_unit, scale<10, static_rational<-15> > > fermi_base_unit;
+
+}
+
+template<>
+struct base_unit_info<metric::fermi_base_unit> {
+ static const char* name() { return("fermi"); }
+ static const char* symbol() { return("fm"); }
+};
+
+}
+}
+
+#endif // BOOST_UNIT_SYSTEMS_METRIC_FERMI_HPP_INCLUDED
diff --git a/boost/units/base_units/metric/hectare.hpp b/boost/units/base_units/metric/hectare.hpp
new file mode 100644
index 0000000..476b0fc
--- /dev/null
+++ b/boost/units/base_units/metric/hectare.hpp
@@ -0,0 +1,19 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_METRIC_HECTARE_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_METRIC_HECTARE_HPP_INCLUDED
+
+#include <boost/units/conversion.hpp>
+#include <boost/units/systems/si/area.hpp>
+
+BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, hectare, "hectare", "ha", 1.0e4, si::area, 12);
+
+#endif // BOOST_UNIT_SYSTEMS_METRIC_HECTARE_HPP_INCLUDED
diff --git a/boost/units/base_units/metric/hour.hpp b/boost/units/base_units/metric/hour.hpp
new file mode 100644
index 0000000..443e250
--- /dev/null
+++ b/boost/units/base_units/metric/hour.hpp
@@ -0,0 +1,37 @@
+ // Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_METRIC_HOUR_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_METRIC_HOUR_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/units_fwd.hpp>
+#include <boost/units/base_units/si/second.hpp>
+
+namespace boost {
+namespace units {
+namespace metric {
+
+typedef scaled_base_unit<boost::units::si::second_base_unit, scale<60, static_rational<2> > > hour_base_unit;
+
+}
+
+template<>
+struct base_unit_info<metric::hour_base_unit> {
+ static const char* name() { return("hour"); }
+ static const char* symbol() { return("h"); }
+};
+
+}
+}
+
+#endif // BOOST_UNIT_SYSTEMS_METRIC_HOUR_HPP_INCLUDED
diff --git a/boost/units/base_units/metric/knot.hpp b/boost/units/base_units/metric/knot.hpp
new file mode 100644
index 0000000..6b85e6e
--- /dev/null
+++ b/boost/units/base_units/metric/knot.hpp
@@ -0,0 +1,19 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_METRIC_KNOT_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_METRIC_KNOT_HPP_INCLUDED
+
+#include <boost/units/conversion.hpp>
+#include <boost/units/systems/si/velocity.hpp>
+
+BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, knot, "knot", "kt", 1852./3600., boost::units::si::velocity, -403);
+
+#endif // BOOST_UNIT_SYSTEMS_METRIC_KNOT_HPP_INCLUDED
diff --git a/boost/units/base_units/metric/liter.hpp b/boost/units/base_units/metric/liter.hpp
new file mode 100644
index 0000000..da90175
--- /dev/null
+++ b/boost/units/base_units/metric/liter.hpp
@@ -0,0 +1,19 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_METRIC_LITER_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_METRIC_LITER_HPP_INCLUDED
+
+#include <boost/units/conversion.hpp>
+#include <boost/units/systems/si/volume.hpp>
+
+BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, liter, "liter", "L", 1.0e-3, si::volume, 13);
+
+#endif // BOOST_UNIT_SYSTEMS_METRIC_LITER_HPP_INCLUDED
diff --git a/boost/units/base_units/metric/micron.hpp b/boost/units/base_units/metric/micron.hpp
new file mode 100644
index 0000000..0965836
--- /dev/null
+++ b/boost/units/base_units/metric/micron.hpp
@@ -0,0 +1,36 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_METRIC_MICRON_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_METRIC_MICRON_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/si/meter.hpp>
+
+namespace boost {
+namespace units {
+namespace metric {
+
+typedef scaled_base_unit<boost::units::si::meter_base_unit, scale<10, static_rational<-6> > > micron_base_unit;
+
+}
+
+template<>
+struct base_unit_info<metric::micron_base_unit> {
+ static const char* name() { return("micron"); }
+ static const char* symbol() { return("u"); }
+};
+
+}
+}
+
+#endif // BOOST_UNIT_SYSTEMS_METRIC_MICRON_HPP_INCLUDED
diff --git a/boost/units/base_units/metric/minute.hpp b/boost/units/base_units/metric/minute.hpp
new file mode 100644
index 0000000..c2f9e6b
--- /dev/null
+++ b/boost/units/base_units/metric/minute.hpp
@@ -0,0 +1,37 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_METRIC_MINUTE_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_METRIC_MINUTE_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/units_fwd.hpp>
+#include <boost/units/base_units/si/second.hpp>
+
+namespace boost {
+namespace units {
+namespace metric {
+
+typedef scaled_base_unit<boost::units::si::second_base_unit, scale<60, static_rational<1> > > minute_base_unit;
+
+}
+
+template<>
+struct base_unit_info<metric::minute_base_unit> {
+ static const char* name() { return("minute"); }
+ static const char* symbol() { return("min"); }
+};
+
+}
+}
+
+#endif // BOOST_UNIT_SYSTEMS_METRIC_MINUTE_HPP_INCLUDED
diff --git a/boost/units/base_units/metric/mmHg.hpp b/boost/units/base_units/metric/mmHg.hpp
new file mode 100644
index 0000000..93e3869
--- /dev/null
+++ b/boost/units/base_units/metric/mmHg.hpp
@@ -0,0 +1,19 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_METRIC_MMHG_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_METRIC_MMHG_HPP_INCLUDED
+
+#include <boost/units/conversion.hpp>
+#include <boost/units/systems/si/pressure.hpp>
+
+BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, mmHg, "millimeters mercury", "mmHg", 133.322, si::pressure, -404);
+
+#endif // BOOST_UNIT_SYSTEMS_METRIC_MMHG_HPP_INCLUDED
diff --git a/boost/units/base_units/metric/nautical_mile.hpp b/boost/units/base_units/metric/nautical_mile.hpp
new file mode 100644
index 0000000..d42dd77
--- /dev/null
+++ b/boost/units/base_units/metric/nautical_mile.hpp
@@ -0,0 +1,36 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_METRIC_NAUTICAL_MILE_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_METRIC_NAUTICAL_MILE_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/si/meter.hpp>
+
+namespace boost {
+namespace units {
+namespace metric {
+
+typedef scaled_base_unit<boost::units::si::meter_base_unit, scale<1852, static_rational<1> > > nautical_mile_base_unit;
+
+}
+
+template<>
+struct base_unit_info<metric::nautical_mile_base_unit> {
+ static const char* name() { return("nautical mile"); }
+ static const char* symbol() { return("nmi"); }
+};
+
+}
+}
+
+#endif // BOOST_UNIT_SYSTEMS_METRIC_NAUTICAL_MILE_HPP_INCLUDED
diff --git a/boost/units/base_units/metric/ton.hpp b/boost/units/base_units/metric/ton.hpp
new file mode 100644
index 0000000..a842aaa
--- /dev/null
+++ b/boost/units/base_units/metric/ton.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_METRIC_TON_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_METRIC_TON_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/units_fwd.hpp>
+#include <boost/units/base_units/si/kilogram.hpp>
+//#include <boost/units/base_units/cgs/gram.hpp>
+
+namespace boost {
+namespace units {
+namespace metric {
+
+//typedef scaled_base_unit<boost::units::cgs::gram_base_unit, scale<10, static_rational<6> > > ton_base_unit;
+typedef scaled_base_unit<boost::units::si::kilogram_base_unit, scale<1000, static_rational<1> > > ton_base_unit;
+
+}
+
+template<>
+struct base_unit_info<metric::ton_base_unit> {
+ static const char* name() { return("metric ton"); }
+ static const char* symbol() { return("t"); }
+};
+
+}
+}
+
+#endif // BOOST_UNIT_SYSTEMS_METRIC_TON_HPP_INCLUDED
diff --git a/boost/units/base_units/metric/torr.hpp b/boost/units/base_units/metric/torr.hpp
new file mode 100644
index 0000000..08fd29a
--- /dev/null
+++ b/boost/units/base_units/metric/torr.hpp
@@ -0,0 +1,19 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_METRIC_TORR_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_METRIC_TORR_HPP_INCLUDED
+
+#include <boost/units/conversion.hpp>
+#include <boost/units/systems/si/pressure.hpp>
+
+BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, torr, "torr", "Torr", 1.01325e5/760.0, si::pressure, -401);
+
+#endif
diff --git a/boost/units/base_units/metric/year.hpp b/boost/units/base_units/metric/year.hpp
new file mode 100644
index 0000000..e43acd6
--- /dev/null
+++ b/boost/units/base_units/metric/year.hpp
@@ -0,0 +1,38 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_OTHER_YEAR_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_OTHER_YEAR_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/si/second.hpp>
+
+// Julian year = 365.25 days exactly = 8766 hours exactly
+
+namespace boost {
+namespace units {
+namespace metric {
+
+typedef scaled_base_unit<boost::units::si::second_base_unit, scale<31557600, static_rational<1> > > year_base_unit;
+
+}
+
+template<>
+struct base_unit_info<metric::year_base_unit> {
+ static const char* name() { return("Julian year"); }
+ static const char* symbol() { return("yr"); }
+};
+
+}
+}
+
+#endif
diff --git a/boost/units/base_units/si/ampere.hpp b/boost/units/base_units/si/ampere.hpp
new file mode 100644
index 0000000..0c21d67
--- /dev/null
+++ b/boost/units/base_units/si/ampere.hpp
@@ -0,0 +1,48 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_SI_AMPERE_BASE_UNIT_HPP
+#define BOOST_UNITS_SI_AMPERE_BASE_UNIT_HPP
+
+#include <string>
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_unit.hpp>
+#include <boost/units/physical_dimensions/current.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace si {
+
+struct ampere_base_unit : public base_unit<ampere_base_unit, current_dimension, -6>
+{
+ static std::string name() { return("ampere"); }
+ static std::string symbol() { return("A"); }
+};
+
+} // namespace si
+
+} // namespace units
+
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::si::ampere_base_unit)
+
+#endif
+
+//#include <boost/units/base_units/detail/conversions.hpp>
+
+#endif // BOOST_UNITS_SI_AMPERE_BASE_UNIT_HPP
diff --git a/boost/units/base_units/si/candela.hpp b/boost/units/base_units/si/candela.hpp
new file mode 100644
index 0000000..ab7a795
--- /dev/null
+++ b/boost/units/base_units/si/candela.hpp
@@ -0,0 +1,48 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_SI_CANDELA_BASE_UNIT_HPP
+#define BOOST_UNITS_SI_CANDELA_BASE_UNIT_HPP
+
+#include <string>
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_unit.hpp>
+#include <boost/units/physical_dimensions/luminous_intensity.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace si {
+
+struct candela_base_unit : public base_unit<candela_base_unit, luminous_intensity_dimension, -3>
+{
+ static std::string name() { return("candela"); }
+ static std::string symbol() { return("cd"); }
+};
+
+} // namespace si
+
+} // namespace units
+
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::si::candela_base_unit)
+
+#endif
+
+//#include <boost/units/base_units/detail/conversions.hpp>
+
+#endif // BOOST_UNITS_SI_CANDELA_BASE_UNIT_HPP
diff --git a/boost/units/base_units/si/kelvin.hpp b/boost/units/base_units/si/kelvin.hpp
new file mode 100644
index 0000000..78fe1dd
--- /dev/null
+++ b/boost/units/base_units/si/kelvin.hpp
@@ -0,0 +1,48 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_SI_KELVIN_BASE_UNIT_HPP
+#define BOOST_UNITS_SI_KELVIN_BASE_UNIT_HPP
+
+#include <string>
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_unit.hpp>
+#include <boost/units/physical_dimensions/temperature.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace si {
+
+struct kelvin_base_unit : public base_unit<kelvin_base_unit, temperature_dimension, -5>
+{
+ static std::string name() { return("kelvin"); }
+ static std::string symbol() { return("K"); }
+};
+
+} // namespace si
+
+} // namespace units
+
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::si::kelvin_base_unit)
+
+#endif
+
+//#include <boost/units/base_units/detail/conversions.hpp>
+
+#endif // BOOST_UNITS_SI_KELVIN_BASE_UNIT_HPP
diff --git a/boost/units/base_units/si/kilogram.hpp b/boost/units/base_units/si/kilogram.hpp
new file mode 100644
index 0000000..0f8b0a6
--- /dev/null
+++ b/boost/units/base_units/si/kilogram.hpp
@@ -0,0 +1,31 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_SI_KILOGRAM_BASE_UNIT_HPP
+#define BOOST_UNITS_SI_KILOGRAM_BASE_UNIT_HPP
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/base_units/cgs/gram.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace si {
+
+typedef scaled_base_unit<boost::units::cgs::gram_base_unit, scale<10, static_rational<3> > > kilogram_base_unit;
+
+} // namespace si
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_SI_KILOGRAM_BASE_UNIT_HPP
diff --git a/boost/units/base_units/si/meter.hpp b/boost/units/base_units/si/meter.hpp
new file mode 100644
index 0000000..3a5fed2
--- /dev/null
+++ b/boost/units/base_units/si/meter.hpp
@@ -0,0 +1,50 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_SI_METER_BASE_UNIT_HPP
+#define BOOST_UNITS_SI_METER_BASE_UNIT_HPP
+
+#include <string>
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_unit.hpp>
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace si {
+
+struct meter_base_unit : public base_unit<meter_base_unit, length_dimension, -9>
+{
+ static std::string name() { return("meter"); }
+ static std::string symbol() { return("m"); }
+};
+
+} // namespace si
+
+} // namespace units
+
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::si::meter_base_unit)
+
+#endif
+
+//#include <boost/units/base_units/detail/conversions.hpp>
+
+#endif // BOOST_UNITS_SI_METER_BASE_UNIT_HPP
+
diff --git a/boost/units/base_units/si/mole.hpp b/boost/units/base_units/si/mole.hpp
new file mode 100644
index 0000000..5b73313
--- /dev/null
+++ b/boost/units/base_units/si/mole.hpp
@@ -0,0 +1,48 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_SI_MOLE_BASE_UNIT_HPP
+#define BOOST_UNITS_SI_MOLE_BASE_UNIT_HPP
+
+#include <string>
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_unit.hpp>
+#include <boost/units/physical_dimensions/amount.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace si {
+
+struct mole_base_unit : public base_unit<mole_base_unit, amount_dimension, -4>
+{
+ static std::string name() { return("mole"); }
+ static std::string symbol() { return("mol"); }
+};
+
+} // namespace si
+
+} // namespace units
+
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::si::mole_base_unit)
+
+#endif
+
+//#include <boost/units/base_units/detail/conversions.hpp>
+
+#endif // BOOST_UNITS_SI_MOLE_BASE_UNIT_HPP
diff --git a/boost/units/base_units/si/second.hpp b/boost/units/base_units/si/second.hpp
new file mode 100644
index 0000000..946c671
--- /dev/null
+++ b/boost/units/base_units/si/second.hpp
@@ -0,0 +1,48 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_SI_SECOND_BASE_UNIT_HPP
+#define BOOST_UNITS_SI_SECOND_BASE_UNIT_HPP
+
+#include <string>
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_unit.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace si {
+
+struct second_base_unit : public base_unit<second_base_unit, time_dimension, -7>
+{
+ static std::string name() { return("second"); }
+ static std::string symbol() { return("s"); }
+};
+
+} // namespace si
+
+} // namespace units
+
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::si::second_base_unit)
+
+#endif
+
+//#include <boost/units/base_units/detail/conversions.hpp>
+
+#endif // BOOST_UNITS_SI_SECOND_BASE_UNIT_HPP
diff --git a/boost/units/base_units/temperature/celsius.hpp b/boost/units/base_units/temperature/celsius.hpp
new file mode 100644
index 0000000..dff70a1
--- /dev/null
+++ b/boost/units/base_units/temperature/celsius.hpp
@@ -0,0 +1,48 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_TEMPERATURE_CELSIUS_BASE_UNIT_HPP
+#define BOOST_UNITS_TEMPERATURE_CELSIUS_BASE_UNIT_HPP
+
+#include <string>
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_unit.hpp>
+#include <boost/units/physical_dimensions/temperature.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace temperature {
+
+struct celsius_base_unit : public base_unit<celsius_base_unit, temperature_dimension, -1008>
+{
+ static std::string name() { return("celsius"); }
+ static std::string symbol() { return("C"); }
+};
+
+} // namespace temperature
+
+} // namespace units
+
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::temperature::celsius_base_unit)
+
+#endif
+
+#include <boost/units/base_units/temperature/conversions.hpp>
+
+#endif // BOOST_UNITS_TEMPERATURE_CELSIUS_BASE_UNIT_HPP
diff --git a/boost/units/base_units/temperature/conversions.hpp b/boost/units/base_units/temperature/conversions.hpp
new file mode 100644
index 0000000..e4e45de
--- /dev/null
+++ b/boost/units/base_units/temperature/conversions.hpp
@@ -0,0 +1,42 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// No include guards. This header is intended to be included
+// multiple times.
+
+// units of temperature
+
+#if defined(BOOST_UNITS_SI_KELVIN_BASE_UNIT_HPP) && defined(BOOST_UNITS_TEMPERATURE_CELSIUS_BASE_UNIT_HPP) &&\
+ !defined(BOOST_UNITS_SYSTEMS_KELVIN_TO_CELSIUS_CONVERSION_DEFINED)
+ #define BOOST_UNITS_SYSTEMS_KELVIN_TO_CELSIUS_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ #include <boost/units/absolute.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::si::kelvin_base_unit, boost::units::temperature::celsius_base_unit, one, make_one());
+ BOOST_UNITS_DEFINE_CONVERSION_OFFSET(boost::units::si::kelvin_base_unit, boost::units::temperature::celsius_base_unit, double, -273.15);
+#endif
+
+#if defined(BOOST_UNITS_SI_KELVIN_BASE_UNIT_HPP) && defined(BOOST_UNITS_TEMPERATURE_FAHRENHEIT_BASE_UNIT_HPP) &&\
+ !defined(BOOST_UNITS_SYSTEMS_KELVIN_TO_FAHRENHEIT_CONVERSION_DEFINED)
+ #define BOOST_UNITS_SYSTEMS_KELVIN_TO_FAHRENHEIT_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ #include <boost/units/absolute.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::si::kelvin_base_unit, boost::units::temperature::fahrenheit_base_unit, double, 9.0/5.0);
+ BOOST_UNITS_DEFINE_CONVERSION_OFFSET(boost::units::si::kelvin_base_unit, boost::units::temperature::fahrenheit_base_unit, double, -273.15 * 9.0 / 5.0 + 32.0);
+#endif
+
+#if defined(BOOST_UNITS_TEMPERATURE_CELSIUS_BASE_UNIT_HPP) && defined(BOOST_UNITS_TEMPERATURE_FAHRENHEIT_BASE_UNIT_HPP) &&\
+ !defined(BOOST_UNITS_SYSTEMS_CELSUIS_TO_FAHRENHEIT_CONVERSION_DEFINED)
+ #define BOOST_UNITS_SYSTEMS_CELSUIS_TO_FAHRENHEIT_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ #include <boost/units/absolute.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::temperature::celsius_base_unit, boost::units::temperature::fahrenheit_base_unit, double, 9.0/5.0);
+ BOOST_UNITS_DEFINE_CONVERSION_OFFSET(boost::units::temperature::celsius_base_unit, boost::units::temperature::fahrenheit_base_unit, double, 32.0);
+#endif
+
diff --git a/boost/units/base_units/temperature/fahrenheit.hpp b/boost/units/base_units/temperature/fahrenheit.hpp
new file mode 100644
index 0000000..ff0149f
--- /dev/null
+++ b/boost/units/base_units/temperature/fahrenheit.hpp
@@ -0,0 +1,48 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_TEMPERATURE_FAHRENHEIT_BASE_UNIT_HPP
+#define BOOST_UNITS_TEMPERATURE_FAHRENHEIT_BASE_UNIT_HPP
+
+#include <string>
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_unit.hpp>
+#include <boost/units/physical_dimensions/temperature.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace temperature {
+
+struct fahrenheit_base_unit : public base_unit<fahrenheit_base_unit, temperature_dimension, -1007>
+{
+ static std::string name() { return("fahrenheit"); }
+ static std::string symbol() { return("F"); }
+};
+
+} // namespace temperature
+
+} // namespace units
+
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::temperature::fahrenheit_base_unit)
+
+#endif
+
+#include <boost/units/base_units/temperature/conversions.hpp>
+
+#endif // BOOST_UNITS_TEMPERATURE_FAHRENHEIT_BASE_UNIT_HPP
diff --git a/boost/units/base_units/us/cup.hpp b/boost/units/base_units/us/cup.hpp
new file mode 100644
index 0000000..f811373
--- /dev/null
+++ b/boost/units/base_units/us/cup.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_BASE_UNITS_US_CUP_HPP_INCLUDED
+#define BOOST_UNITS_BASE_UNITS_US_CUP_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/us/pint.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace us {
+
+typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<-1> > > cup_base_unit;
+
+} // namespace us
+
+template<>
+struct base_unit_info<us::cup_base_unit> {
+ static const char* name() { return("cup"); }
+ static const char* symbol() { return("c"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_BASE_UNITS_US_CUP_HPP_INCLUDED
diff --git a/boost/units/base_units/us/dram.hpp b/boost/units/base_units/us/dram.hpp
new file mode 100644
index 0000000..73fc44f
--- /dev/null
+++ b/boost/units/base_units/us/dram.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_BASE_UNITS_US_DRAM_HPP_INCLUDED
+#define BOOST_UNIT_BASE_UNITS_US_DRAM_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/us/pound.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace us {
+
+typedef scaled_base_unit<pound_base_unit, scale<16, static_rational<-2> > > dram_base_unit;
+
+} // namespace us
+
+template<>
+struct base_unit_info<us::dram_base_unit> {
+ static const char* name() { return("dram (U.S.)"); }
+ static const char* symbol() { return("dr"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNIT_BASE_UNITS_US_DRAM_HPP_INCLUDED
diff --git a/boost/units/base_units/us/fluid_dram.hpp b/boost/units/base_units/us/fluid_dram.hpp
new file mode 100644
index 0000000..cf0c85d
--- /dev/null
+++ b/boost/units/base_units/us/fluid_dram.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_BASE_UNITS_US_FLUID_DRAM_HPP_INCLUDED
+#define BOOST_UNITS_BASE_UNITS_US_FLUID_DRAM_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/us/pint.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace us {
+
+typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<-7> > > fluid_dram_base_unit;
+
+} // namespace us
+
+template<>
+struct base_unit_info<us::fluid_dram_base_unit> {
+ static const char* name() { return("fluid dram (U.S.)"); }
+ static const char* symbol() { return("fl dr"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_BASE_UNITS_US_FLUID_DRAM_HPP_INCLUDED
diff --git a/boost/units/base_units/us/fluid_ounce.hpp b/boost/units/base_units/us/fluid_ounce.hpp
new file mode 100644
index 0000000..0c9d7e9
--- /dev/null
+++ b/boost/units/base_units/us/fluid_ounce.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_BASE_UNITS_US_FLUID_OUNCE_HPP_INCLUDED
+#define BOOST_UNITS_BASE_UNITS_US_FLUID_OUNCE_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/us/pint.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace us {
+
+typedef scaled_base_unit<pint_base_unit, scale<16, static_rational<-1> > > fluid_ounce_base_unit;
+
+} // namespace us
+
+template<>
+struct base_unit_info<us::fluid_ounce_base_unit> {
+ static const char* name() { return("fluid ounce (U.S.)"); }
+ static const char* symbol() { return("fl oz"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_BASE_UNITS_US_FLUID_OUNCE_HPP_INCLUDED
diff --git a/boost/units/base_units/us/foot.hpp b/boost/units/base_units/us/foot.hpp
new file mode 100644
index 0000000..4b529bb
--- /dev/null
+++ b/boost/units/base_units/us/foot.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_US_FOOT_BASE_UNIT_HPP
+#define BOOST_UNITS_US_FOOT_BASE_UNIT_HPP
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/us/yard.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace us {
+
+typedef scaled_base_unit<yard_base_unit, scale<3, static_rational<-1> > > foot_base_unit;
+
+} // namespace us
+
+template<>
+struct base_unit_info<us::foot_base_unit> {
+ static const char* name() { return("foot"); }
+ static const char* symbol() { return("ft"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_US_FOOT_BASE_UNIT_HPP
diff --git a/boost/units/base_units/us/gallon.hpp b/boost/units/base_units/us/gallon.hpp
new file mode 100644
index 0000000..a7314c5
--- /dev/null
+++ b/boost/units/base_units/us/gallon.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_BASE_UNITS_US_GALLON_HPP_INCLUDED
+#define BOOST_UNITS_BASE_UNITS_US_GALLON_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/us/pint.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace us {
+
+typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<3> > > gallon_base_unit;
+
+} // namespace us
+
+template<>
+struct base_unit_info<us::gallon_base_unit> {
+ static const char* name() { return("gallon (U.S.)"); }
+ static const char* symbol() { return("gal"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_BASE_UNITS_US_GALLON_HPP_INCLUDED
diff --git a/boost/units/base_units/us/gill.hpp b/boost/units/base_units/us/gill.hpp
new file mode 100644
index 0000000..e937343
--- /dev/null
+++ b/boost/units/base_units/us/gill.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_BASE_UNITS_US_GILL_HPP_INCLUDED
+#define BOOST_UNITS_BASE_UNITS_US_GILL_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/us/pint.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace us {
+
+typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<-2> > > gill_base_unit;
+
+} // namespace us
+
+template<>
+struct base_unit_info<us::gill_base_unit> {
+ static const char* name() { return("gill (U.S.)"); }
+ static const char* symbol() { return("gi"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_BASE_UNITS_US_GILL_HPP_INCLUDED
diff --git a/boost/units/base_units/us/grain.hpp b/boost/units/base_units/us/grain.hpp
new file mode 100644
index 0000000..e21baf6
--- /dev/null
+++ b/boost/units/base_units/us/grain.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_BASE_UNITS_US_GRAIN_HPP_INCLUDED
+#define BOOST_UNIT_BASE_UNITS_US_GRAIN_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/us/pound.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace us {
+
+typedef scaled_base_unit<pound_base_unit, scale<7000, static_rational<-1> > > grain_base_unit;
+
+} // namespace us
+
+template<>
+struct base_unit_info<us::grain_base_unit> {
+ static const char* name() { return("grain"); }
+ static const char* symbol() { return("gr"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNIT_BASE_UNITS_US_GRAIN_HPP_INCLUDED
diff --git a/boost/units/base_units/us/hundredweight.hpp b/boost/units/base_units/us/hundredweight.hpp
new file mode 100644
index 0000000..0bccd49
--- /dev/null
+++ b/boost/units/base_units/us/hundredweight.hpp
@@ -0,0 +1,40 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_BASE_UNITS_US_HUNDREDWEIGHT_HPP_INCLUDED
+#define BOOST_UNIT_BASE_UNITS_US_HUNDREDWEIGHT_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/us/pound.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace us {
+
+//typedef scaled_base_unit<pound_base_unit, scale<10, static_rational<2> > > hundredweight_base_unit;
+typedef scaled_base_unit<pound_base_unit, scale<100, static_rational<1> > > hundredweight_base_unit;
+
+} // namespace us
+
+template<>
+struct base_unit_info<us::hundredweight_base_unit> {
+ static const char* name() { return("hundredweight (U.S.)"); }
+ static const char* symbol() { return("cwt"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNIT_BASE_UNITS_US_HUNDREDWEIGHT_HPP_INCLUDED
diff --git a/boost/units/base_units/us/inch.hpp b/boost/units/base_units/us/inch.hpp
new file mode 100644
index 0000000..05bd59a
--- /dev/null
+++ b/boost/units/base_units/us/inch.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_US_INCH_BASE_UNIT_HPP
+#define BOOST_UNITS_US_INCH_BASE_UNIT_HPP
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/us/yard.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace us {
+
+typedef scaled_base_unit<yard_base_unit, scale<36, static_rational<-1> > > inch_base_unit;
+
+} // namespace us
+
+template<>
+struct base_unit_info<us::inch_base_unit> {
+ static const char* name() { return("inch"); }
+ static const char* symbol() { return("in"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_US_INCH_BASE_UNIT_HPP
diff --git a/boost/units/base_units/us/mil.hpp b/boost/units/base_units/us/mil.hpp
new file mode 100644
index 0000000..ee75b79
--- /dev/null
+++ b/boost/units/base_units/us/mil.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_US_MIL_BASE_UNIT_HPP
+#define BOOST_UNITS_US_MIL_BASE_UNIT_HPP
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/us/yard.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace us {
+
+typedef scaled_base_unit<yard_base_unit, scale<36000, static_rational<-1> > > mil_base_unit;
+
+} // namespace us
+
+template<>
+struct base_unit_info<us::mil_base_unit> {
+ static const char* name() { return("mil"); }
+ static const char* symbol() { return("mil"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_US_MIL_BASE_UNIT_HPP
diff --git a/boost/units/base_units/us/mile.hpp b/boost/units/base_units/us/mile.hpp
new file mode 100644
index 0000000..d3513f1
--- /dev/null
+++ b/boost/units/base_units/us/mile.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_US_MILE_BASE_UNIT_HPP
+#define BOOST_UNITS_US_MILE_BASE_UNIT_HPP
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/us/yard.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace us {
+
+typedef scaled_base_unit<yard_base_unit, scale<1760, static_rational<1> > > mile_base_unit;
+
+} // namespace us
+
+template<>
+struct base_unit_info<us::mile_base_unit> {
+ static const char* name() { return("mile"); }
+ static const char* symbol() { return("mi"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_US_MILE_BASE_UNIT_HPP
diff --git a/boost/units/base_units/us/minim.hpp b/boost/units/base_units/us/minim.hpp
new file mode 100644
index 0000000..bf266cd
--- /dev/null
+++ b/boost/units/base_units/us/minim.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_BASE_UNITS_US_MINIM_HPP_INCLUDED
+#define BOOST_UNITS_BASE_UNITS_US_MINIM_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/us/pint.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace us {
+
+typedef scaled_base_unit<pint_base_unit, scale<7680, static_rational<-1> > > minim_base_unit;
+
+} // namespace us
+
+template<>
+struct base_unit_info<us::minim_base_unit> {
+ static const char* name() { return("minim (U.S.)"); }
+ static const char* symbol() { return("minim"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_BASE_UNITS_US_MINIM_HPP_INCLUDED
diff --git a/boost/units/base_units/us/ounce.hpp b/boost/units/base_units/us/ounce.hpp
new file mode 100644
index 0000000..5f88f83
--- /dev/null
+++ b/boost/units/base_units/us/ounce.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_US_OUNCE_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_US_OUNCE_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/us/pound.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace us {
+
+typedef scaled_base_unit<pound_base_unit, scale<2, static_rational<-4> > > ounce_base_unit;
+
+} // namespace us
+
+template<>
+struct base_unit_info<us::ounce_base_unit> {
+ static const char* name() { return("ounce"); }
+ static const char* symbol() { return("oz"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNIT_SYSTEMS_US_OUNCE_HPP_INCLUDED
diff --git a/boost/units/base_units/us/pint.hpp b/boost/units/base_units/us/pint.hpp
new file mode 100644
index 0000000..3a923b8
--- /dev/null
+++ b/boost/units/base_units/us/pint.hpp
@@ -0,0 +1,28 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_BASE_UNITS_US_PINT_HPP_INCLUDED
+#define BOOST_UNITS_BASE_UNITS_US_PINT_HPP_INCLUDED
+
+#include <boost/units/config.hpp>
+#include <boost/units/systems/si/volume.hpp>
+#include <boost/units/conversion.hpp>
+
+BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(us, pint, "pint (U.S.)", "pt", 0.4731765e-3, si::volume, -503);
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::us::pint_base_unit)
+
+#endif
+
+#endif // BOOST_UNITS_BASE_UNITS_US_PINT_HPP_INCLUDED
diff --git a/boost/units/base_units/us/pound.hpp b/boost/units/base_units/us/pound.hpp
new file mode 100644
index 0000000..bef6cde
--- /dev/null
+++ b/boost/units/base_units/us/pound.hpp
@@ -0,0 +1,32 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_US_POUND_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_US_POUND_HPP_INCLUDED
+
+#include <string>
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_unit.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/base_units/cgs/gram.hpp>
+#include <boost/units/conversion.hpp>
+
+BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(us, pound, "pound", "lb", 453.59237, cgs::gram_base_unit, -502); // exact conversion
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::us::pound_base_unit)
+
+#endif
+
+#endif // BOOST_UNIT_SYSTEMS_US_POUND_HPP_INCLUDED
diff --git a/boost/units/base_units/us/pound_force.hpp b/boost/units/base_units/us/pound_force.hpp
new file mode 100644
index 0000000..9749d5e
--- /dev/null
+++ b/boost/units/base_units/us/pound_force.hpp
@@ -0,0 +1,32 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2009 Matthias Christian Schabel
+// Copyright (C) 2007-2009 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_US_POUND_FORCE_HPP_INCLUDED
+#define BOOST_UNIT_SYSTEMS_US_POUND_FORCE_HPP_INCLUDED
+
+#include <string>
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_unit.hpp>
+//#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/systems/si/force.hpp>
+#include <boost/units/conversion.hpp>
+
+BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(us, pound_force, "pound-force", "lbf", 4.4482216152605, si::force, -600); // exact conversion
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::us::pound_force_base_unit)
+
+#endif
+
+#endif // BOOST_UNIT_SYSTEMS_US_POUND_FORCE_HPP_INCLUDED
diff --git a/boost/units/base_units/us/quart.hpp b/boost/units/base_units/us/quart.hpp
new file mode 100644
index 0000000..45cf6a9
--- /dev/null
+++ b/boost/units/base_units/us/quart.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_BASE_UNITS_US_QUART_HPP_INCLUDED
+#define BOOST_UNITS_BASE_UNITS_US_QUART_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/us/pint.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace us {
+
+typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<1> > > quart_base_unit;
+
+} // namespace us
+
+template<>
+struct base_unit_info<us::quart_base_unit> {
+ static const char* name() { return("quart (U.S.)"); }
+ static const char* symbol() { return("qt"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_BASE_UNITS_US_QUART_HPP_INCLUDED
diff --git a/boost/units/base_units/us/tablespoon.hpp b/boost/units/base_units/us/tablespoon.hpp
new file mode 100644
index 0000000..f95f0a2
--- /dev/null
+++ b/boost/units/base_units/us/tablespoon.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_BASE_UNITS_US_TABLESPOON_HPP_INCLUDED
+#define BOOST_UNITS_BASE_UNITS_US_TABLESPOON_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/us/pint.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace us {
+
+typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<-5> > > tablespoon_base_unit;
+
+} // namespace us
+
+template<>
+struct base_unit_info<us::tablespoon_base_unit> {
+ static const char* name() { return("tablespoon"); }
+ static const char* symbol() { return("tbsp"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_BASE_UNITS_US_TABLESPOON_HPP_INCLUDED
diff --git a/boost/units/base_units/us/teaspoon.hpp b/boost/units/base_units/us/teaspoon.hpp
new file mode 100644
index 0000000..8f8dd73
--- /dev/null
+++ b/boost/units/base_units/us/teaspoon.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_BASE_UNITS_US_TEASPOON_HPP_INCLUDED
+#define BOOST_UNITS_BASE_UNITS_US_TEASPOON_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/us/pint.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace us {
+
+typedef scaled_base_unit<pint_base_unit, scale<96, static_rational<-1> > > teaspoon_base_unit;
+
+} // namespace us
+
+template<>
+struct base_unit_info<us::teaspoon_base_unit> {
+ static const char* name() { return("teaspoon"); }
+ static const char* symbol() { return("tsp"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_BASE_UNITS_US_TEASPOON_HPP_INCLUDED
diff --git a/boost/units/base_units/us/ton.hpp b/boost/units/base_units/us/ton.hpp
new file mode 100644
index 0000000..84daa85
--- /dev/null
+++ b/boost/units/base_units/us/ton.hpp
@@ -0,0 +1,39 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_BASE_UNITS_US_TON_HPP_INCLUDED
+#define BOOST_UNIT_BASE_UNITS_US_TON_HPP_INCLUDED
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/base_units/us/pound.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace us {
+
+typedef scaled_base_unit<pound_base_unit, scale<2000, static_rational<1> > > ton_base_unit;
+
+} // namespace us
+
+template<>
+struct base_unit_info<us::ton_base_unit> {
+ static const char* name() { return("short ton"); }
+ static const char* symbol() { return("t"); }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNIT_BASE_UNITS_US_TON_HPP_INCLUDED
diff --git a/boost/units/base_units/us/yard.hpp b/boost/units/base_units/us/yard.hpp
new file mode 100644
index 0000000..b609eae
--- /dev/null
+++ b/boost/units/base_units/us/yard.hpp
@@ -0,0 +1,32 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_SYSTEMS_US_YARD_BASE_UNIT_HPP
+#define BOOST_UNITS_SYSTEMS_US_YARD_BASE_UNIT_HPP
+
+#include <string>
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_unit.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/base_units/si/meter.hpp>
+#include <boost/units/conversion.hpp>
+
+BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(us, yard, "yard", "yd", 0.9144, si::meter_base_unit, -501); // exact conversion
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::us::yard_base_unit)
+
+#endif
+
+#endif // BOOST_UNITS_SYSTEMS_US_YARD_BASE_UNIT_HPP
diff --git a/boost/units/cmath.hpp b/boost/units/cmath.hpp
new file mode 100644
index 0000000..238b31c
--- /dev/null
+++ b/boost/units/cmath.hpp
@@ -0,0 +1,676 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_CMATH_HPP
+#define BOOST_UNITS_CMATH_HPP
+
+#include <boost/config/no_tr1/cmath.hpp>
+#include <cstdlib>
+
+#include <boost/math/special_functions/fpclassify.hpp>
+#include <boost/math/special_functions/hypot.hpp>
+#include <boost/math/special_functions/next.hpp>
+#include <boost/math/special_functions/round.hpp>
+#include <boost/math/special_functions/sign.hpp>
+
+#include <boost/units/dimensionless_quantity.hpp>
+#include <boost/units/pow.hpp>
+#include <boost/units/quantity.hpp>
+#include <boost/units/detail/cmath_impl.hpp>
+#include <boost/units/detail/dimensionless_unit.hpp>
+
+#include <boost/units/systems/si/plane_angle.hpp>
+
+/// \file
+/// \brief Overloads of functions in \<cmath\> for quantities.
+/// \details Only functions for which a dimensionally-correct result type
+/// can be determined are overloaded.
+/// All functions work with dimensionless quantities.
+
+// BOOST_PREVENT_MACRO_SUBSTITUTION is needed on certain compilers that define
+// some <cmath> functions as macros; it is used for all functions even though it
+// isn't necessary -- I didn't want to think :)
+//
+// the form using namespace detail; return(f(x)); is used
+// to enable ADL for UDTs.
+
+namespace boost {
+
+namespace units {
+
+template<class Unit,class Y>
+inline
+bool
+isfinite BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
+{
+ using boost::math::isfinite;
+ return isfinite BOOST_PREVENT_MACRO_SUBSTITUTION (q.value());
+}
+
+template<class Unit,class Y>
+inline
+bool
+isinf BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
+{
+ using boost::math::isinf;
+ return isinf BOOST_PREVENT_MACRO_SUBSTITUTION (q.value());
+}
+
+template<class Unit,class Y>
+inline
+bool
+isnan BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
+{
+ using boost::math::isnan;
+ return isnan BOOST_PREVENT_MACRO_SUBSTITUTION (q.value());
+}
+
+template<class Unit,class Y>
+inline
+bool
+isnormal BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
+{
+ using boost::math::isnormal;
+ return isnormal BOOST_PREVENT_MACRO_SUBSTITUTION (q.value());
+}
+
+template<class Unit,class Y>
+inline
+bool
+isgreater BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,
+ const quantity<Unit,Y>& q2)
+{
+ using namespace detail;
+ return isgreater BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value());
+}
+
+template<class Unit,class Y>
+inline
+bool
+isgreaterequal BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,
+ const quantity<Unit,Y>& q2)
+{
+ using namespace detail;
+ return isgreaterequal BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value());
+}
+
+template<class Unit,class Y>
+inline
+bool
+isless BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,
+ const quantity<Unit,Y>& q2)
+{
+ using namespace detail;
+ return isless BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value());
+}
+
+template<class Unit,class Y>
+inline
+bool
+islessequal BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,
+ const quantity<Unit,Y>& q2)
+{
+ using namespace detail;
+ return islessequal BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value());
+}
+
+template<class Unit,class Y>
+inline
+bool
+islessgreater BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,
+ const quantity<Unit,Y>& q2)
+{
+ using namespace detail;
+ return islessgreater BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value());
+}
+
+template<class Unit,class Y>
+inline
+bool
+isunordered BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,
+ const quantity<Unit,Y>& q2)
+{
+ using namespace detail;
+ return isunordered BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value());
+}
+
+template<class Unit,class Y>
+inline
+quantity<Unit,Y>
+abs BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
+{
+ using std::abs;
+
+ typedef quantity<Unit,Y> quantity_type;
+
+ return quantity_type::from_value(abs BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()));
+}
+
+template<class Unit,class Y>
+inline
+quantity<Unit,Y>
+ceil BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
+{
+ using std::ceil;
+
+ typedef quantity<Unit,Y> quantity_type;
+
+ return quantity_type::from_value(ceil BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()));
+}
+
+template<class Unit,class Y>
+inline
+quantity<Unit,Y>
+copysign BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,
+ const quantity<Unit,Y>& q2)
+{
+ using boost::math::copysign;
+
+ typedef quantity<Unit,Y> quantity_type;
+
+ return quantity_type::from_value(copysign BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value()));
+}
+
+template<class Unit,class Y>
+inline
+quantity<Unit,Y>
+fabs BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
+{
+ using std::fabs;
+
+ typedef quantity<Unit,Y> quantity_type;
+
+ return quantity_type::from_value(fabs BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()));
+}
+
+template<class Unit,class Y>
+inline
+quantity<Unit,Y>
+floor BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
+{
+ using std::floor;
+
+ typedef quantity<Unit,Y> quantity_type;
+
+ return quantity_type::from_value(floor BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()));
+}
+
+template<class Unit,class Y>
+inline
+quantity<Unit,Y>
+fdim BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,
+ const quantity<Unit,Y>& q2)
+{
+ using namespace detail;
+
+ typedef quantity<Unit,Y> quantity_type;
+
+ return quantity_type::from_value(fdim BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value()));
+}
+
+#if 0
+
+template<class Unit1,class Unit2,class Unit3,class Y>
+inline
+typename add_typeof_helper<
+ typename multiply_typeof_helper<quantity<Unit1,Y>,
+ quantity<Unit2,Y> >::type,
+ quantity<Unit3,Y> >::type
+fma BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit1,Y>& q1,
+ const quantity<Unit2,Y>& q2,
+ const quantity<Unit3,Y>& q3)
+{
+ using namespace detail;
+
+ typedef quantity<Unit1,Y> type1;
+ typedef quantity<Unit2,Y> type2;
+ typedef quantity<Unit3,Y> type3;
+
+ typedef typename multiply_typeof_helper<type1,type2>::type prod_type;
+ typedef typename add_typeof_helper<prod_type,type3>::type quantity_type;
+
+ return quantity_type::from_value(fma BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value(),q3.value()));
+}
+
+#endif
+
+template<class Unit,class Y>
+inline
+quantity<Unit,Y>
+fmax BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,
+ const quantity<Unit,Y>& q2)
+{
+ using namespace detail;
+
+ typedef quantity<Unit,Y> quantity_type;
+
+ return quantity_type::from_value(fmax BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value()));
+}
+
+template<class Unit,class Y>
+inline
+quantity<Unit,Y>
+fmin BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,
+ const quantity<Unit,Y>& q2)
+{
+ using namespace detail;
+
+ typedef quantity<Unit,Y> quantity_type;
+
+ return quantity_type::from_value(fmin BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value()));
+}
+
+template<class Unit,class Y>
+inline
+int
+fpclassify BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
+{
+ using boost::math::fpclassify;
+
+ return fpclassify BOOST_PREVENT_MACRO_SUBSTITUTION (q.value());
+}
+
+template<class Unit,class Y>
+inline
+typename root_typeof_helper<
+ typename add_typeof_helper<
+ typename power_typeof_helper<quantity<Unit,Y>,
+ static_rational<2> >::type,
+ typename power_typeof_helper<quantity<Unit,Y>,
+ static_rational<2> >::type>::type,
+ static_rational<2> >::type
+hypot BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,const quantity<Unit,Y>& q2)
+{
+ using boost::math::hypot;
+
+ typedef quantity<Unit,Y> type1;
+
+ typedef typename power_typeof_helper<type1,static_rational<2> >::type pow_type;
+ typedef typename add_typeof_helper<pow_type,pow_type>::type add_type;
+ typedef typename root_typeof_helper<add_type,static_rational<2> >::type quantity_type;
+
+ return quantity_type::from_value(hypot BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value()));
+}
+
+// does ISO C++ support long long? g++ claims not
+//template<class Unit,class Y>
+//inline
+//quantity<Unit,long long>
+//llrint BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
+//{
+// using namespace detail;
+//
+// typedef quantity<Unit,long long> quantity_type;
+//
+// return quantity_type::from_value(llrint BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()));
+//}
+
+// does ISO C++ support long long? g++ claims not
+//template<class Unit,class Y>
+//inline
+//quantity<Unit,long long>
+//llround BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
+//{
+// using namespace detail;
+//
+// typedef quantity<Unit,long long> quantity_type;
+//
+// return quantity_type::from_value(llround BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()));
+//}
+
+#if 0
+
+template<class Unit,class Y>
+inline
+quantity<Unit,Y>
+nearbyint BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
+{
+ using namespace detail;
+
+ typedef quantity<Unit,Y> quantity_type;
+
+ return quantity_type::from_value(nearbyint BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()));
+}
+
+#endif
+
+template<class Unit,class Y>
+inline
+quantity<Unit,Y> nextafter BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,
+ const quantity<Unit,Y>& q2)
+{
+ using boost::math::nextafter;
+
+ typedef quantity<Unit,Y> quantity_type;
+
+ return quantity_type::from_value(nextafter BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value()));
+}
+template<class Unit,class Y>
+inline
+quantity<Unit,Y> nexttoward BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q1,
+ const quantity<Unit,Y>& q2)
+{
+ // the only difference between nextafter and nexttowards is
+ // in the argument types. Since we are requiring identical
+ // argument types, there is no difference.
+ using boost::math::nextafter;
+
+ typedef quantity<Unit,Y> quantity_type;
+
+ return quantity_type::from_value(nextafter BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value()));
+}
+
+#if 0
+
+template<class Unit,class Y>
+inline
+quantity<Unit,Y>
+rint BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
+{
+ using namespace detail;
+
+ typedef quantity<Unit,Y> quantity_type;
+
+ return quantity_type::from_value(rint BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()));
+}
+
+#endif
+
+template<class Unit,class Y>
+inline
+quantity<Unit,Y>
+round BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
+{
+ using boost::math::round;
+
+ typedef quantity<Unit,Y> quantity_type;
+
+ return quantity_type::from_value(round BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()));
+}
+
+template<class Unit,class Y>
+inline
+int
+signbit BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
+{
+ using boost::math::signbit;
+
+ return signbit BOOST_PREVENT_MACRO_SUBSTITUTION (q.value());
+}
+
+template<class Unit,class Y>
+inline
+quantity<Unit,Y>
+trunc BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity<Unit,Y>& q)
+{
+ using namespace detail;
+
+ typedef quantity<Unit,Y> quantity_type;
+
+ return quantity_type::from_value(trunc BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()));
+}
+
+template<class Unit,class Y>
+inline
+quantity<Unit, Y>
+fmod(const quantity<Unit,Y>& q1, const quantity<Unit,Y>& q2)
+{
+ using std::fmod;
+
+ typedef quantity<Unit,Y> quantity_type;
+
+ return quantity_type::from_value(fmod(q1.value(), q2.value()));
+}
+
+template<class Unit, class Y>
+inline
+quantity<Unit, Y>
+modf(const quantity<Unit, Y>& q1, quantity<Unit, Y>* q2)
+{
+ using std::modf;
+
+ typedef quantity<Unit,Y> quantity_type;
+
+ return quantity_type::from_value(modf(q1.value(), &quantity_cast<Y&>(*q2)));
+}
+
+template<class Unit, class Y, class Int>
+inline
+quantity<Unit, Y>
+frexp(const quantity<Unit, Y>& q,Int* ex)
+{
+ using std::frexp;
+
+ typedef quantity<Unit,Y> quantity_type;
+
+ return quantity_type::from_value(frexp(q.value(),ex));
+}
+
+/// For non-dimensionless quantities, integral and rational powers
+/// and roots can be computed by @c pow<Ex> and @c root<Rt> respectively.
+template<class S, class Y>
+inline
+quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y>
+pow(const quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y>& q1,
+ const quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y>& q2)
+{
+ using std::pow;
+
+ typedef quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S),Y> quantity_type;
+
+ return quantity_type::from_value(pow(q1.value(), q2.value()));
+}
+
+template<class S, class Y>
+inline
+quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y>
+exp(const quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y>& q)
+{
+ using std::exp;
+
+ typedef quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y> quantity_type;
+
+ return quantity_type::from_value(exp(q.value()));
+}
+
+template<class Unit, class Y, class Int>
+inline
+quantity<Unit, Y>
+ldexp(const quantity<Unit, Y>& q,const Int& ex)
+{
+ using std::ldexp;
+
+ typedef quantity<Unit,Y> quantity_type;
+
+ return quantity_type::from_value(ldexp(q.value(), ex));
+}
+
+template<class S, class Y>
+inline
+quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y>
+log(const quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y>& q)
+{
+ using std::log;
+
+ typedef quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y> quantity_type;
+
+ return quantity_type::from_value(log(q.value()));
+}
+
+template<class S, class Y>
+inline
+quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y>
+log10(const quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y>& q)
+{
+ using std::log10;
+
+ typedef quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(S), Y> quantity_type;
+
+ return quantity_type::from_value(log10(q.value()));
+}
+
+template<class Unit,class Y>
+inline
+typename root_typeof_helper<
+ quantity<Unit,Y>,
+ static_rational<2>
+ >::type
+sqrt(const quantity<Unit,Y>& q)
+{
+ using std::sqrt;
+
+ typedef typename root_typeof_helper<
+ quantity<Unit,Y>,
+ static_rational<2>
+ >::type quantity_type;
+
+ return quantity_type::from_value(sqrt(q.value()));
+}
+
+} // namespace units
+
+} // namespace boost
+
+namespace boost {
+
+namespace units {
+
+// trig functions with si argument/return types
+
+/// cos of theta in radians
+template<class Y>
+typename dimensionless_quantity<si::system,Y>::type
+cos(const quantity<si::plane_angle,Y>& theta)
+{
+ using std::cos;
+ return cos(theta.value());
+}
+
+/// sin of theta in radians
+template<class Y>
+typename dimensionless_quantity<si::system,Y>::type
+sin(const quantity<si::plane_angle,Y>& theta)
+{
+ using std::sin;
+ return sin(theta.value());
+}
+
+/// tan of theta in radians
+template<class Y>
+typename dimensionless_quantity<si::system,Y>::type
+tan(const quantity<si::plane_angle,Y>& theta)
+{
+ using std::tan;
+ return tan(theta.value());
+}
+
+/// cos of theta in other angular units
+template<class System,class Y>
+typename dimensionless_quantity<System,Y>::type
+cos(const quantity<unit<plane_angle_dimension,System>,Y>& theta)
+{
+ return cos(quantity<si::plane_angle,Y>(theta));
+}
+
+/// sin of theta in other angular units
+template<class System,class Y>
+typename dimensionless_quantity<System,Y>::type
+sin(const quantity<unit<plane_angle_dimension,System>,Y>& theta)
+{
+ return sin(quantity<si::plane_angle,Y>(theta));
+}
+
+/// tan of theta in other angular units
+template<class System,class Y>
+typename dimensionless_quantity<System,Y>::type
+tan(const quantity<unit<plane_angle_dimension,System>,Y>& theta)
+{
+ return tan(quantity<si::plane_angle,Y>(theta));
+}
+
+/// acos of dimensionless quantity returning angle in same system
+template<class Y,class System>
+quantity<unit<plane_angle_dimension, homogeneous_system<System> >,Y>
+acos(const quantity<unit<dimensionless_type, homogeneous_system<System> >,Y>& val)
+{
+ using std::acos;
+ return quantity<unit<plane_angle_dimension, homogeneous_system<System> >,Y>(acos(val.value())*si::radians);
+}
+
+/// acos of dimensionless quantity returning angle in radians
+template<class Y>
+quantity<angle::radian_base_unit::unit_type,Y>
+acos(const quantity<unit<dimensionless_type, heterogeneous_dimensionless_system>,Y>& val)
+{
+ using std::acos;
+ return quantity<angle::radian_base_unit::unit_type,Y>::from_value(acos(val.value()));
+}
+
+/// asin of dimensionless quantity returning angle in same system
+template<class Y,class System>
+quantity<unit<plane_angle_dimension, homogeneous_system<System> >,Y>
+asin(const quantity<unit<dimensionless_type, homogeneous_system<System> >,Y>& val)
+{
+ using std::asin;
+ return quantity<unit<plane_angle_dimension, homogeneous_system<System> >,Y>(asin(val.value())*si::radians);
+}
+
+/// asin of dimensionless quantity returning angle in radians
+template<class Y>
+quantity<angle::radian_base_unit::unit_type,Y>
+asin(const quantity<unit<dimensionless_type, heterogeneous_dimensionless_system>,Y>& val)
+{
+ using std::asin;
+ return quantity<angle::radian_base_unit::unit_type,Y>::from_value(asin(val.value()));
+}
+
+/// atan of dimensionless quantity returning angle in same system
+template<class Y,class System>
+quantity<unit<plane_angle_dimension, homogeneous_system<System> >,Y>
+atan(const quantity<unit<dimensionless_type, homogeneous_system<System> >, Y>& val)
+{
+ using std::atan;
+ return quantity<unit<plane_angle_dimension, homogeneous_system<System> >,Y>(atan(val.value())*si::radians);
+}
+
+/// atan of dimensionless quantity returning angle in radians
+template<class Y>
+quantity<angle::radian_base_unit::unit_type,Y>
+atan(const quantity<unit<dimensionless_type, heterogeneous_dimensionless_system>, Y>& val)
+{
+ using std::atan;
+ return quantity<angle::radian_base_unit::unit_type,Y>::from_value(atan(val.value()));
+}
+
+/// atan2 of @c value_type returning angle in radians
+template<class Y, class Dimension, class System>
+quantity<unit<plane_angle_dimension, homogeneous_system<System> >, Y>
+atan2(const quantity<unit<Dimension, homogeneous_system<System> >, Y>& y,
+ const quantity<unit<Dimension, homogeneous_system<System> >, Y>& x)
+{
+ using std::atan2;
+ return quantity<unit<plane_angle_dimension, homogeneous_system<System> >, Y>(atan2(y.value(),x.value())*si::radians);
+}
+
+/// atan2 of @c value_type returning angle in radians
+template<class Y, class Dimension, class System>
+quantity<angle::radian_base_unit::unit_type,Y>
+atan2(const quantity<unit<Dimension, heterogeneous_system<System> >, Y>& y,
+ const quantity<unit<Dimension, heterogeneous_system<System> >, Y>& x)
+{
+ using std::atan2;
+ return quantity<angle::radian_base_unit::unit_type,Y>::from_value(atan2(y.value(),x.value()));
+}
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_CMATH_HPP
diff --git a/boost/units/config.hpp b/boost/units/config.hpp
new file mode 100644
index 0000000..9e8a74f
--- /dev/null
+++ b/boost/units/config.hpp
@@ -0,0 +1,105 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_CONFIG_HPP
+#define BOOST_UNITS_CONFIG_HPP
+
+#include <boost/config.hpp>
+#include <boost/version.hpp>
+
+#ifndef BOOST_UNITS_HAS_BOOST_TYPEOF
+ #if (BOOST_VERSION >= 103400)
+ ///INTERNAL ONLY
+ #define BOOST_UNITS_HAS_BOOST_TYPEOF 1
+ #else
+ ///INTERNAL ONLY
+ #define BOOST_UNITS_HAS_BOOST_TYPEOF 0
+ #endif
+#endif
+
+#if (BOOST_UNITS_HAS_BOOST_TYPEOF)
+ #include <boost/typeof/typeof.hpp>
+ ///INTERNAL ONLY
+ #define BOOST_UNITS_HAS_TYPEOF 1
+#else
+ #if (__GNUC__ && __cplusplus && __GNUC__ >= 3)
+ ///INTERNAL ONLY
+ #define BOOST_UNITS_HAS_TYPEOF 1
+ ///INTERNAL ONLY
+ #define BOOST_UNITS_HAS_GNU_TYPEOF 1
+ #elif defined(__MWERKS__)
+ ///INTERNAL ONLY
+ #define BOOST_UNITS_HAS_TYPEOF 1
+ ///INTERNAL ONLY
+ #define BOOST_UNITS_HAS_MWERKS_TYPEOF 1
+ #else
+ ///INTERNAL ONLY
+ #define BOOST_UNITS_HAS_TYPEOF 0
+ #endif
+#endif
+
+// uncomment this to test without typeof support at all
+//#undef BOOST_UNITS_HAS_TYPEOF
+//#define BOOST_UNITS_HAS_TYPEOF 0
+
+#ifndef BOOST_UNITS_NO_COMPILER_CHECK
+
+ #ifdef BOOST_NO_MEMBER_TEMPLATES
+ #error Boost.Units requires member template
+ #endif
+
+ #ifdef BOOST_NO_MEMBER_TEMPLATE_KEYWORD
+ #error Boost.Units requires member template keyword
+ #endif
+
+ #ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
+ #error Boost.Units requires in class member initialization
+ #endif
+
+ #ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+ #error Boost.Units requires function template partial ordering
+ #endif
+
+ #ifdef BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
+ #error Boost.Units requires explicit function template arguments
+ #endif
+
+ #ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ #error Boost.Units requires partial specialization
+ #endif
+
+#endif
+
+#ifdef BOOST_UNITS_REQUIRE_LAYOUT_COMPATIBILITY
+ ///INTERNAL ONLY
+ #define BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(a, b) BOOST_STATIC_ASSERT((sizeof(a) == sizeof(b)))
+#else
+ ///INTERNAL ONLY
+ #define BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(a, b) ((void)0)
+#endif
+
+#ifdef BOOST_UNITS_DOXYGEN
+
+/// If defined will trigger a static assertion if quantity<Unit, T>
+/// is not layout compatible with T
+#define BOOST_UNITS_REQUIRE_LAYOUT_COMPATIBILITY
+
+/// If defined will disable a preprocessor check that the
+/// compiler is able to handle the library.
+#define BOOST_UNITS_NO_COMPILER_CHECK
+
+/// Enable checking to verify that a homogeneous system
+/// is actually capable of representing all the dimensions
+/// that it is used with. Off by default.
+#define BOOST_UNITS_CHECK_HOMOGENEOUS_UNITS
+
+#endif
+
+#endif
diff --git a/boost/units/conversion.hpp b/boost/units/conversion.hpp
new file mode 100644
index 0000000..5f739aa
--- /dev/null
+++ b/boost/units/conversion.hpp
@@ -0,0 +1,183 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_CONVERSION_HPP
+#define BOOST_UNITS_CONVERSION_HPP
+
+/// \file
+/// \brief Template for defining conversions between quantities.
+
+#include <boost/units/detail/conversion_impl.hpp>
+
+namespace boost {
+
+namespace units {
+
+template<class From, class To>
+struct conversion_helper;
+
+#ifdef BOOST_UNITS_DOXYGEN
+
+/// Template for defining conversions between
+/// quantities. This template should be specialized
+/// for every quantity that allows conversions.
+/// For example, if you have a two units
+/// called pair and dozen you would write
+/// @code
+/// namespace boost {
+/// namespace units {
+/// template<class T0, class T1>
+/// struct conversion_helper<quantity<dozen, T0>, quantity<pair, T1> >
+/// {
+/// static quantity<pair, T1> convert(const quantity<dozen, T0>& source)
+/// {
+/// return(quantity<pair, T1>::from_value(6 * source.value()));
+/// }
+/// };
+/// }
+/// }
+/// @endcode
+///
+/// In most cases, the predefined specializations for @c unit
+/// and @c absolute should be sufficient, so users should rarely
+/// need to use this.
+template<class From, class To>
+struct conversion_helper
+{
+ static To convert(const From&);
+};
+
+#endif
+
+/// Defines the conversion factor from a base unit to any unit
+/// or to another base unit with the correct dimensions. Uses
+/// of this macro must appear at global scope.
+/// If the destination unit is a base unit or a unit that contains
+/// only one base unit which is raised to the first power (e.g. feet->meters)
+/// the reverse (meters->feet in this example) need not be defined explicitly.
+#define BOOST_UNITS_DEFINE_CONVERSION_FACTOR(Source, Destination, type_, value_) \
+ namespace boost { \
+ namespace units { \
+ template<> \
+ struct select_base_unit_converter< \
+ unscale<Source>::type, \
+ unscale<reduce_unit<Destination::unit_type>::type>::type \
+ > \
+ { \
+ typedef Source source_type; \
+ typedef reduce_unit<Destination::unit_type>::type destination_type; \
+ }; \
+ template<> \
+ struct base_unit_converter<Source, reduce_unit<Destination::unit_type>::type> \
+ { \
+ static const bool is_defined = true; \
+ typedef type_ type; \
+ static type value() { return(value_); } \
+ }; \
+ } \
+ } \
+ void boost_units_require_semicolon()
+
+/// Defines the conversion factor from a base unit to any other base
+/// unit with the same dimensions. Params should be a Boost.Preprocessor
+/// Seq of template parameters, such as (class T1)(class T2)
+/// All uses of must appear at global scope. The reverse conversion will
+/// be defined automatically. This macro is a little dangerous, because,
+/// unlike the non-template form, it will silently fail if either base
+/// unit is scaled. This is probably not an issue if both the source
+/// and destination types depend on the template parameters, but be aware
+/// that a generic conversion to kilograms is not going to work.
+#define BOOST_UNITS_DEFINE_CONVERSION_FACTOR_TEMPLATE(Params, Source, Destination, type_, value_) \
+ namespace boost { \
+ namespace units { \
+ template<BOOST_PP_SEQ_ENUM(Params)> \
+ struct base_unit_converter< \
+ Source, \
+ BOOST_UNITS_MAKE_HETEROGENEOUS_UNIT(Destination, typename Source::dimension_type)\
+ > \
+ { \
+ static const bool is_defined = true; \
+ typedef type_ type; \
+ static type value() { return(value_); } \
+ }; \
+ } \
+ } \
+ void boost_units_require_semicolon()
+
+/// Specifies the default conversion to be applied when
+/// no direct conversion is available.
+/// Source is a base unit. Dest is any unit with the
+/// same dimensions.
+#define BOOST_UNITS_DEFAULT_CONVERSION(Source, Dest) \
+ namespace boost { \
+ namespace units { \
+ template<> \
+ struct unscaled_get_default_conversion<unscale<Source>::type> \
+ { \
+ static const bool is_defined = true; \
+ typedef Dest::unit_type type; \
+ }; \
+ } \
+ } \
+ void boost_units_require_semicolon()
+
+/// Specifies the default conversion to be applied when
+/// no direct conversion is available.
+/// Params is a PP Sequence of template arguments.
+/// Source is a base unit. Dest is any unit with the
+/// same dimensions. The source must not be a scaled
+/// base unit.
+#define BOOST_UNITS_DEFAULT_CONVERSION_TEMPLATE(Params, Source, Dest) \
+ namespace boost { \
+ namespace units { \
+ template<BOOST_PP_SEQ_ENUM(Params)> \
+ struct unscaled_get_default_conversion<Source> \
+ { \
+ static const bool is_defined = true; \
+ typedef typename Dest::unit_type type; \
+ }; \
+ } \
+ } \
+ void boost_units_require_semicolon()
+
+/// INTERNAL ONLY
+/// Users should not create their units in namespace boost::units.
+/// If we want to make this public it needs to allow better control over
+/// the namespaces. --SJW.
+/// template that defines a base_unit and conversion to another dimensionally-consistent unit
+#define BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(namespace_, name_, name_string_, symbol_string_, factor, unit, id)\
+namespace boost { \
+namespace units { \
+namespace namespace_ { \
+struct name_ ## _base_unit \
+ : base_unit<name_ ## _base_unit, unit::dimension_type, id> { \
+ static const char* name() { return(name_string_); } \
+ static const char* symbol() { return(symbol_string_); }; \
+}; \
+} \
+} \
+} \
+BOOST_UNITS_DEFINE_CONVERSION_FACTOR(namespace_::name_ ## _base_unit, unit, double, factor); \
+BOOST_UNITS_DEFAULT_CONVERSION(namespace_::name_ ## _base_unit, unit)
+
+/// Find the conversion factor between two units.
+template<class FromUnit,class ToUnit>
+inline
+typename detail::conversion_factor_helper<FromUnit, ToUnit>::type
+conversion_factor(const FromUnit&,const ToUnit&)
+{
+ return(detail::conversion_factor_helper<FromUnit, ToUnit>::value());
+}
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_CONVERSION_HPP
diff --git a/boost/units/derived_dimension.hpp b/boost/units/derived_dimension.hpp
new file mode 100644
index 0000000..54cc46a
--- /dev/null
+++ b/boost/units/derived_dimension.hpp
@@ -0,0 +1,208 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_DERIVED_DIMENSION_HPP
+
+#include <boost/units/dim.hpp>
+#include <boost/units/dimension.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/units_fwd.hpp>
+#include <boost/units/detail/dimension_list.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// A utility class for defining composite dimensions with integer powers.
+template<class DT1 = dimensionless_type,long E1 = 0,
+ class DT2 = dimensionless_type,long E2 = 0,
+ class DT3 = dimensionless_type,long E3 = 0,
+ class DT4 = dimensionless_type,long E4 = 0,
+ class DT5 = dimensionless_type,long E5 = 0,
+ class DT6 = dimensionless_type,long E6 = 0,
+ class DT7 = dimensionless_type,long E7 = 0,
+ class DT8 = dimensionless_type,long E8 = 0>
+struct derived_dimension
+{
+#ifdef BOOST_UNITS_DOXYGEN
+ typedef detail::unspecified type;
+#else
+ typedef typename
+ make_dimension_list< list< dim< DT1,static_rational<E1> >,
+ list< dim< DT2,static_rational<E2> >,
+ list< dim< DT3,static_rational<E3> >,
+ list< dim< DT4,static_rational<E4> >,
+ list< dim< DT5,static_rational<E5> >,
+ list< dim< DT6,static_rational<E6> >,
+ list< dim< DT7,static_rational<E7> >,
+ list< dim< DT8,static_rational<E8> >, dimensionless_type > > > > > > > > >::type type;
+#endif
+};
+
+/// INTERNAL ONLY
+template<class DT1,long E1>
+struct derived_dimension<
+ DT1, E1,
+ dimensionless_type,0,
+ dimensionless_type,0,
+ dimensionless_type,0,
+ dimensionless_type,0,
+ dimensionless_type,0,
+ dimensionless_type,0,
+ dimensionless_type,0>
+{
+ typedef typename
+ make_dimension_list< list< dim< DT1,static_rational<E1> >, dimensionless_type > >::type type;
+};
+
+/// INTERNAL ONLY
+template<class DT1,long E1,
+ class DT2,long E2>
+struct derived_dimension<
+ DT1, E1,
+ DT2, E2,
+ dimensionless_type,0,
+ dimensionless_type,0,
+ dimensionless_type,0,
+ dimensionless_type,0,
+ dimensionless_type,0,
+ dimensionless_type,0>
+{
+ typedef typename
+ make_dimension_list< list< dim< DT1,static_rational<E1> >,
+ list< dim< DT2,static_rational<E2> >, dimensionless_type > > >::type type;
+};
+
+/// INTERNAL ONLY
+template<class DT1,long E1,
+ class DT2,long E2,
+ class DT3,long E3>
+struct derived_dimension<
+ DT1, E1,
+ DT2, E2,
+ DT3, E3,
+ dimensionless_type,0,
+ dimensionless_type,0,
+ dimensionless_type,0,
+ dimensionless_type,0,
+ dimensionless_type,0>
+{
+ typedef typename
+ make_dimension_list< list< dim< DT1,static_rational<E1> >,
+ list< dim< DT2,static_rational<E2> >,
+ list< dim< DT3,static_rational<E3> >, dimensionless_type > > > >::type type;
+};
+
+/// INTERNAL ONLY
+template<class DT1,long E1,
+ class DT2,long E2,
+ class DT3,long E3,
+ class DT4,long E4>
+struct derived_dimension<
+ DT1, E1,
+ DT2, E2,
+ DT3, E3,
+ DT4, E4,
+ dimensionless_type,0,
+ dimensionless_type,0,
+ dimensionless_type,0,
+ dimensionless_type,0>
+{
+ typedef typename
+ make_dimension_list< list< dim< DT1,static_rational<E1> >,
+ list< dim< DT2,static_rational<E2> >,
+ list< dim< DT3,static_rational<E3> >,
+ list< dim< DT4,static_rational<E4> >, dimensionless_type > > > > >::type type;
+};
+
+/// INTERNAL ONLY
+template<class DT1,long E1,
+ class DT2,long E2,
+ class DT3,long E3,
+ class DT4,long E4,
+ class DT5,long E5>
+struct derived_dimension<
+ DT1, E1,
+ DT2, E2,
+ DT3, E3,
+ DT4, E4,
+ DT5, E5,
+ dimensionless_type,0,
+ dimensionless_type,0,
+ dimensionless_type,0>
+{
+ typedef typename
+ make_dimension_list< list< dim< DT1,static_rational<E1> >,
+ list< dim< DT2,static_rational<E2> >,
+ list< dim< DT3,static_rational<E3> >,
+ list< dim< DT4,static_rational<E4> >,
+ list< dim< DT5,static_rational<E5> >, dimensionless_type > > > > > >::type type;
+};
+
+/// INTERNAL ONLY
+template<class DT1,long E1,
+ class DT2,long E2,
+ class DT3,long E3,
+ class DT4,long E4,
+ class DT5,long E5,
+ class DT6,long E6>
+struct derived_dimension<
+ DT1, E1,
+ DT2, E2,
+ DT3, E3,
+ DT4, E4,
+ DT5, E5,
+ DT6, E6,
+ dimensionless_type,0,
+ dimensionless_type,0>
+{
+ typedef typename
+ make_dimension_list< list< dim< DT1,static_rational<E1> >,
+ list< dim< DT2,static_rational<E2> >,
+ list< dim< DT3,static_rational<E3> >,
+ list< dim< DT4,static_rational<E4> >,
+ list< dim< DT5,static_rational<E5> >,
+ list< dim< DT6,static_rational<E6> >, dimensionless_type > > > > > > >::type type;
+};
+
+/// INTERNAL ONLY
+template<class DT1,long E1,
+ class DT2,long E2,
+ class DT3,long E3,
+ class DT4,long E4,
+ class DT5,long E5,
+ class DT6,long E6,
+ class DT7,long E7>
+struct derived_dimension<
+ DT1, E1,
+ DT2, E2,
+ DT3, E3,
+ DT4, E4,
+ DT5, E5,
+ DT6, E6,
+ DT7, E7,
+ dimensionless_type,0>
+{
+ typedef typename
+ make_dimension_list< list< dim< DT1,static_rational<E1> >,
+ list< dim< DT2,static_rational<E2> >,
+ list< dim< DT3,static_rational<E3> >,
+ list< dim< DT4,static_rational<E4> >,
+ list< dim< DT5,static_rational<E5> >,
+ list< dim< DT6,static_rational<E6> >,
+ list< dim< DT7,static_rational<E7> >, dimensionless_type > > > > > > > >::type type;
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_DERIVED_DIMENSION_HPP
diff --git a/boost/units/detail/absolute_impl.hpp b/boost/units/detail/absolute_impl.hpp
new file mode 100644
index 0000000..127b33a
--- /dev/null
+++ b/boost/units/detail/absolute_impl.hpp
@@ -0,0 +1,104 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_ABSOLUTE_IMPL_HPP
+#define BOOST_UNITS_ABSOLUTE_IMPL_HPP
+
+#include <iosfwd>
+
+#include <boost/units/config.hpp>
+#include <boost/units/conversion.hpp>
+#include <boost/units/heterogeneous_system.hpp>
+#include <boost/units/units_fwd.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// INTERNAL ONLY
+template<class D, class S>
+struct reduce_unit<absolute<unit<D, S> > >
+{
+ typedef absolute<typename reduce_unit<unit<D, S> >::type> type;
+};
+
+namespace detail {
+
+struct undefined_affine_conversion_base {
+ static const bool is_defined = false;
+};
+
+} // namespace detail
+
+/// INTERNAL ONLY
+template<class From, class To>
+struct affine_conversion_helper : detail::undefined_affine_conversion_base { };
+
+namespace detail {
+
+template<bool IsDefined, bool ReverseIsDefined>
+struct affine_conversion_impl;
+
+template<bool ReverseIsDefined>
+struct affine_conversion_impl<true, ReverseIsDefined>
+{
+ template<class Unit1, class Unit2, class T0, class T1>
+ struct apply {
+ static T1 value(const T0& t0)
+ {
+ return(
+ t0 *
+ conversion_factor(Unit1(), Unit2()) +
+ affine_conversion_helper<typename reduce_unit<Unit1>::type, typename reduce_unit<Unit2>::type>::value());
+ }
+ };
+};
+
+template<>
+struct affine_conversion_impl<false, true>
+{
+ template<class Unit1, class Unit2, class T0, class T1>
+ struct apply
+ {
+ static T1 value(const T0& t0)
+ {
+ return(
+ (t0 - affine_conversion_helper<typename reduce_unit<Unit2>::type, typename reduce_unit<Unit1>::type>::value()) *
+ conversion_factor(Unit1(), Unit2()));
+ }
+ };
+};
+
+} // namespace detail
+
+/// INTERNAL ONLY
+template<class Unit1, class T1, class Unit2, class T2>
+struct conversion_helper<quantity<absolute<Unit1>, T1>, quantity<absolute<Unit2>, T2> >
+{
+ typedef quantity<absolute<Unit1>, T1> from_quantity_type;
+ typedef quantity<absolute<Unit2>, T2> to_quantity_type;
+ static to_quantity_type convert(const from_quantity_type& source)
+ {
+ return(
+ to_quantity_type::from_value(
+ detail::affine_conversion_impl<
+ affine_conversion_helper<typename reduce_unit<Unit1>::type, typename reduce_unit<Unit2>::type>::is_defined,
+ affine_conversion_helper<typename reduce_unit<Unit2>::type, typename reduce_unit<Unit1>::type>::is_defined
+ >::template apply<Unit1, Unit2, T1, T2>::value(source.value())
+ )
+ );
+ }
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_ABSOLUTE_IMPL_HPP
diff --git a/boost/units/detail/cmath_impl.hpp b/boost/units/detail/cmath_impl.hpp
new file mode 100644
index 0000000..d5bec14
--- /dev/null
+++ b/boost/units/detail/cmath_impl.hpp
@@ -0,0 +1,154 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_CMATH_IMPL_HPP
+#define BOOST_UNITS_CMATH_IMPL_HPP
+
+#include <boost/config.hpp>
+#include <boost/math/special_functions/fpclassify.hpp>
+
+namespace boost {
+namespace units {
+namespace detail {
+
+template<class Y>
+inline bool isgreater BOOST_PREVENT_MACRO_SUBSTITUTION(const Y& v1,const Y& v2)
+{
+ if((boost::math::isnan)(v1) || (boost::math::isnan)(v2)) return false;
+ else return v1 > v2;
+}
+
+template<class Y>
+inline bool isgreaterequal BOOST_PREVENT_MACRO_SUBSTITUTION(const Y& v1,const Y& v2)
+{
+ if((boost::math::isnan)(v1) || (boost::math::isnan)(v2)) return false;
+ else return v1 >= v2;
+}
+
+template<class Y>
+inline bool isless BOOST_PREVENT_MACRO_SUBSTITUTION(const Y& v1,const Y& v2)
+{
+ if((boost::math::isnan)(v1) || (boost::math::isnan)(v2)) return false;
+ else return v1 < v2;
+}
+
+template<class Y>
+inline bool islessequal BOOST_PREVENT_MACRO_SUBSTITUTION(const Y& v1,const Y& v2)
+{
+ if((boost::math::isnan)(v1) || (boost::math::isnan)(v2)) return false;
+ else return v1 <= v2;
+}
+
+template<class Y>
+inline bool islessgreater BOOST_PREVENT_MACRO_SUBSTITUTION(const Y& v1,const Y& v2)
+{
+ if((boost::math::isnan)(v1) || (boost::math::isnan)(v2)) return false;
+ else return v1 < v2 || v1 > v2;
+}
+
+template<class Y>
+inline bool isunordered BOOST_PREVENT_MACRO_SUBSTITUTION(const Y& v1,const Y& v2)
+{
+ return (boost::math::isnan)(v1) || (boost::math::isnan)(v2);
+}
+
+template<class Y>
+inline Y fdim BOOST_PREVENT_MACRO_SUBSTITUTION(const Y& v1,const Y& v2)
+{
+ if((boost::math::isnan)(v1)) return v1;
+ else if((boost::math::isnan)(v2)) return v2;
+ else if(v1 > v2) return(v1 - v2);
+ else return(Y(0));
+}
+
+#if 0
+
+template<class T>
+struct fma_issue_warning {
+ enum { value = false };
+};
+
+template<class Y>
+inline Y fma(const Y& v1,const Y& v2,const Y& v3)
+{
+ //this implementation does *not* meet the
+ //requirement of infinite intermediate precision
+ BOOST_STATIC_WARNING((fma_issue_warning<Y>::value));
+
+ return v1 * v2 + v3;
+}
+
+#endif
+
+template<class Y>
+inline Y fmax BOOST_PREVENT_MACRO_SUBSTITUTION(const Y& v1,const Y& v2)
+{
+ if((boost::math::isnan)(v1)) return(v2);
+ else if((boost::math::isnan)(v2)) return(v1);
+ else if(v1 > v2) return(v1);
+ else return(v2);
+}
+
+template<class Y>
+inline Y fmin BOOST_PREVENT_MACRO_SUBSTITUTION(const Y& v1,const Y& v2)
+{
+ if((boost::math::isnan)(v1)) return(v2);
+ else if((boost::math::isnan)(v2)) return(v1);
+ else if(v1 < v2) return(v1);
+ else return(v2);
+}
+
+//template<class Y>
+//inline long long llrint(const Y& val)
+//{
+// return static_cast<long long>(rint(val));
+//}
+//
+//template<class Y>
+//inline long long llround(const Y& val)
+//{
+// return static_cast<long long>(round(val));
+//}
+
+#if 0
+
+template<class Y>
+inline Y nearbyint(const Y& val)
+{
+ //this is not really correct.
+ //the result should be according to the
+ //current rounding mode.
+ using boost::math::round;
+ return round(val);
+}
+
+template<class Y>
+inline Y rint(const Y& val)
+{
+ //I don't feel like trying to figure out
+ //how to raise a floating pointer exception
+ return nearbyint(val);
+}
+
+#endif
+
+template<class Y>
+inline Y trunc BOOST_PREVENT_MACRO_SUBSTITUTION(const Y& val)
+{
+ if(val > 0) return std::floor(val);
+ else if(val < 0) return std::ceil(val);
+ else return val;
+}
+
+}
+}
+}
+
+#endif // BOOST_UNITS_CMATH_IMPL_HPP
diff --git a/boost/units/detail/conversion_impl.hpp b/boost/units/detail/conversion_impl.hpp
new file mode 100644
index 0000000..8946faf
--- /dev/null
+++ b/boost/units/detail/conversion_impl.hpp
@@ -0,0 +1,458 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_DETAIL_CONVERSION_IMPL_HPP
+#define BOOST_UNITS_DETAIL_CONVERSION_IMPL_HPP
+
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/divides.hpp>
+#include <boost/preprocessor/seq/enum.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+#include <boost/units/heterogeneous_system.hpp>
+#include <boost/units/homogeneous_system.hpp>
+#include <boost/units/reduce_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/units_fwd.hpp>
+#include <boost/units/detail/dimension_list.hpp>
+#include <boost/units/detail/heterogeneous_conversion.hpp>
+#include <boost/units/detail/one.hpp>
+#include <boost/units/detail/static_rational_power.hpp>
+#include <boost/units/detail/unscale.hpp>
+
+#include <boost/units/units_fwd.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace detail {
+
+template<class Source, class Dest>
+struct conversion_factor_helper;
+
+template<class Source, class Dest>
+struct call_base_unit_converter;
+
+}
+
+/// INTERNAL ONLY
+struct undefined_base_unit_converter_base {
+ static const bool is_defined = false;
+};
+
+/// INTERNAL ONLY
+struct no_default_conversion {
+ static const bool is_defined = false;
+};
+
+/// INTERNAL ONLY
+template<class BaseUnit>
+struct unscaled_get_default_conversion : no_default_conversion { };
+
+/// INTERNAL ONLY
+template<bool is_defined>
+struct unscaled_get_default_conversion_impl;
+
+/// INTERNAL ONLY
+template<>
+struct unscaled_get_default_conversion_impl<true>
+{
+ template<class T>
+ struct apply
+ {
+ typedef typename unscaled_get_default_conversion<typename unscale<T>::type>::type type;
+ };
+};
+
+/// INTERNAL ONLY
+template<>
+struct unscaled_get_default_conversion_impl<false>
+{
+ template<class T>
+ struct apply
+ {
+ typedef typename T::unit_type type;
+ };
+};
+
+/// INTERNAL ONLY
+template<class BaseUnit>
+struct get_default_conversion
+{
+ typedef typename unscaled_get_default_conversion_impl<
+ unscaled_get_default_conversion<typename unscale<BaseUnit>::type>::is_defined
+ >::template apply<BaseUnit>::type type;
+};
+
+/// INTERNAL ONLY
+template<class Source, class Destination>
+struct select_base_unit_converter
+{
+ typedef Source source_type;
+ typedef Destination destination_type;
+};
+
+/// INTERNAL ONLY
+template<class Source, class Dest>
+struct base_unit_converter_base : undefined_base_unit_converter_base {
+};
+
+/// INTERNAL ONLY
+template<class Source>
+struct base_unit_converter_base<Source, BOOST_UNITS_MAKE_HETEROGENEOUS_UNIT(Source, typename Source::dimension_type)>
+{
+ static const bool is_defined = true;
+ typedef one type;
+ static type value() {
+ one result;
+ return(result);
+ }
+};
+
+/// INTERNAL ONLY
+template<class Source, class Dest>
+struct base_unit_converter : base_unit_converter_base<Source, Dest> { };
+
+namespace detail {
+
+template<class Source, class Dest>
+struct do_call_base_unit_converter {
+ typedef select_base_unit_converter<typename unscale<Source>::type, typename unscale<Dest>::type> selector;
+ typedef typename selector::source_type source_type;
+ typedef typename selector::destination_type destination_type;
+ typedef base_unit_converter<source_type, destination_type> converter;
+ typedef typename mpl::divides<typename get_scale_list<Source>::type, typename get_scale_list<source_type>::type>::type source_factor;
+ typedef typename mpl::divides<typename get_scale_list<Dest>::type, typename get_scale_list<destination_type>::type>::type destination_factor;
+ typedef typename mpl::divides<source_factor, destination_factor>::type factor;
+ typedef eval_scale_list<factor> eval_factor;
+ typedef typename multiply_typeof_helper<typename converter::type, typename eval_factor::type>::type type;
+ static type value()
+ {
+ return(converter::value() * eval_factor::value());
+ }
+};
+
+template<bool forward_is_defined, bool reverse_is_defined>
+struct call_base_unit_converter_base_unit_impl;
+
+template<>
+struct call_base_unit_converter_base_unit_impl<true, true>
+{
+ template<class Source, class Dest>
+ struct apply
+ : do_call_base_unit_converter<Source, typename Dest::unit_type>
+ {
+ };
+};
+
+template<>
+struct call_base_unit_converter_base_unit_impl<true, false>
+{
+ template<class Source, class Dest>
+ struct apply
+ : do_call_base_unit_converter<Source, typename Dest::unit_type>
+ {
+ };
+};
+
+template<>
+struct call_base_unit_converter_base_unit_impl<false, true>
+{
+ template<class Source, class Dest>
+ struct apply
+ {
+ typedef do_call_base_unit_converter<Dest, typename Source::unit_type> converter;
+ typedef typename divide_typeof_helper<one, typename converter::type>::type type;
+ static type value() {
+ one numerator;
+ return(numerator / converter::value());
+ }
+ };
+};
+
+template<>
+struct call_base_unit_converter_base_unit_impl<false, false>
+{
+ template<class Source, class Dest>
+ struct apply
+ {
+ typedef typename reduce_unit<typename get_default_conversion<Source>::type>::type new_source;
+ typedef typename reduce_unit<typename get_default_conversion<Dest>::type>::type new_dest;
+ typedef call_base_unit_converter<Source, new_source> start;
+ typedef detail::conversion_factor_helper<
+ new_source,
+ new_dest
+ > conversion;
+ typedef call_base_unit_converter<Dest, new_dest> end;
+ typedef typename divide_typeof_helper<
+ typename multiply_typeof_helper<
+ typename start::type,
+ typename conversion::type
+ >::type,
+ typename end::type
+ >::type type;
+ static type value() {
+ return(start::value() * conversion::value() / end::value());
+ }
+ };
+};
+
+template<int N>
+struct get_default_conversion_impl
+{
+ template<class Begin>
+ struct apply
+ {
+ typedef typename Begin::item source_pair;
+ typedef typename source_pair::value_type exponent;
+ typedef typename source_pair::tag_type source;
+ typedef typename reduce_unit<typename get_default_conversion<source>::type>::type new_source;
+ typedef typename get_default_conversion_impl<N-1>::template apply<typename Begin::next> next_iteration;
+ typedef typename multiply_typeof_helper<typename power_typeof_helper<new_source, exponent>::type, typename next_iteration::unit_type>::type unit_type;
+ typedef call_base_unit_converter<source, new_source> conversion;
+ typedef typename multiply_typeof_helper<typename conversion::type, typename next_iteration::type>::type type;
+ static type value() {
+ return(static_rational_power<exponent>(conversion::value()) * next_iteration::value());
+ }
+ };
+};
+
+template<>
+struct get_default_conversion_impl<0>
+{
+ template<class Begin>
+ struct apply
+ {
+ typedef unit<dimensionless_type, heterogeneous_system<heterogeneous_system_impl<dimensionless_type, dimensionless_type, no_scale> > > unit_type;
+ typedef one type;
+ static one value() {
+ one result;
+ return(result);
+ }
+ };
+};
+
+template<bool is_defined>
+struct call_base_unit_converter_impl;
+
+template<>
+struct call_base_unit_converter_impl<true>
+{
+ template<class Source, class Dest>
+ struct apply
+ : do_call_base_unit_converter<Source, Dest>
+ {
+ };
+};
+
+template<>
+struct call_base_unit_converter_impl<false>
+{
+ template<class Source, class Dest>
+ struct apply {
+ typedef typename reduce_unit<typename get_default_conversion<Source>::type>::type new_source;
+ typedef typename Dest::system_type::type system_list;
+ typedef typename get_default_conversion_impl<system_list::size::value>::template apply<system_list> impl;
+ typedef typename impl::unit_type new_dest;
+ typedef call_base_unit_converter<Source, new_source> start;
+ typedef conversion_factor_helper<new_source, new_dest> conversion;
+ typedef typename divide_typeof_helper<
+ typename multiply_typeof_helper<
+ typename start::type,
+ typename conversion::type
+ >::type,
+ typename impl::type
+ >::type type;
+ static type value() {
+ return(start::value() * conversion::value() / impl::value());
+ }
+ };
+};
+
+#define BOOST_UNITS_DETAIL_BASE_UNIT_CONVERTER_IS_DEFINED(Source, Dest)\
+ base_unit_converter<\
+ typename select_base_unit_converter<typename unscale<Source>::type, typename unscale<Dest>::type>::source_type,\
+ typename select_base_unit_converter<typename unscale<Source>::type, typename unscale<Dest>::type>::destination_type\
+ >::is_defined
+
+template<class Source, class Dest>
+struct call_base_unit_converter : call_base_unit_converter_impl<BOOST_UNITS_DETAIL_BASE_UNIT_CONVERTER_IS_DEFINED(Source, Dest)>::template apply<Source, Dest>
+{
+};
+
+template<class Source, class Dest>
+struct call_base_unit_converter<Source, BOOST_UNITS_MAKE_HETEROGENEOUS_UNIT(Dest, typename Source::dimension_type)> :
+ call_base_unit_converter_base_unit_impl<
+ BOOST_UNITS_DETAIL_BASE_UNIT_CONVERTER_IS_DEFINED(Source, typename Dest::unit_type),
+ BOOST_UNITS_DETAIL_BASE_UNIT_CONVERTER_IS_DEFINED(Dest, typename Source::unit_type)
+ >::template apply<Source, Dest>
+{
+};
+
+template<int N>
+struct conversion_impl
+{
+ template<class Begin, class DestinationSystem>
+ struct apply
+ {
+ typedef typename conversion_impl<N-1>::template apply<
+ typename Begin::next,
+ DestinationSystem
+ > next_iteration;
+ typedef typename Begin::item unit_pair;
+ typedef typename unit_pair::tag_type unit;
+ typedef typename unit::dimension_type dimensions;
+ typedef typename reduce_unit<units::unit<dimensions, DestinationSystem> >::type reduced_unit;
+ typedef detail::call_base_unit_converter<unit, reduced_unit> converter;
+ typedef typename multiply_typeof_helper<typename converter::type, typename next_iteration::type>::type type;
+ static type value() { return(static_rational_power<typename unit_pair::value_type>(converter::value()) * next_iteration::value()); }
+ };
+};
+
+template<>
+struct conversion_impl<0>
+{
+ template<class Begin, class DestinationSystem>
+ struct apply
+ {
+ typedef one type;
+ static type value() { one result; return(result); }
+ };
+};
+
+} // namespace detail
+
+/// forward to conversion_factor (intentionally allowing ADL)
+/// INTERNAL ONLY
+template<class Unit1, class T1, class Unit2, class T2>
+struct conversion_helper<quantity<Unit1, T1>, quantity<Unit2, T2> >
+{
+ /// INTERNAL ONLY
+ typedef quantity<Unit2, T2> destination_type;
+ static destination_type convert(const quantity<Unit1, T1>& source)
+ {
+ Unit1 u1;
+ Unit2 u2;
+ return(destination_type::from_value(static_cast<T2>(source.value() * conversion_factor(u1, u2))));
+ }
+};
+
+namespace detail {
+
+template<class Source, class Dest>
+struct conversion_factor_helper;
+
+template<class D, class L1, class L2>
+struct conversion_factor_helper<unit<D, homogeneous_system<L1> >, unit<D, homogeneous_system<L2> > >
+ : conversion_factor_helper<
+ typename reduce_unit<unit<D, homogeneous_system<L1> > >::type,
+ typename reduce_unit<unit<D, homogeneous_system<L2> > >::type
+ >
+{
+ //typedef typename reduce_unit<unit<D, homogeneous_system<L1> > >::type source_unit;
+ //typedef typename source_unit::system_type::type unit_list;
+ //typedef typename detail::conversion_impl<unit_list::size::value>::template apply<
+ // unit_list,
+ // homogeneous_system<L2>
+ //> impl;
+ //typedef typename impl::type type;
+ //static type value()
+ //{
+ // return(impl::value());
+ //}
+};
+
+template<class D, class L1, class L2>
+struct conversion_factor_helper<unit<D, heterogeneous_system<L1> >, unit<D, homogeneous_system<L2> > >
+ : conversion_factor_helper<
+ typename reduce_unit<unit<D, heterogeneous_system<L1> > >::type,
+ typename reduce_unit<unit<D, homogeneous_system<L2> > >::type
+ >
+{
+ //typedef typename detail::conversion_impl<L1::type::size::value>::template apply<
+ // typename L1::type,
+ // homogeneous_system<L2>
+ //> impl;
+ //typedef eval_scale_list<typename L1::scale> scale;
+ //typedef typename multiply_typeof_helper<typename impl::type, typename scale::type>::type type;
+ //static type value()
+ //{
+ // return(impl::value() * scale::value());
+ //}
+};
+
+// There is no simple algorithm for doing this conversion
+// other than just defining it as the reverse of the
+// heterogeneous->homogeneous case
+template<class D, class L1, class L2>
+struct conversion_factor_helper<unit<D, homogeneous_system<L1> >, unit<D, heterogeneous_system<L2> > >
+ : conversion_factor_helper<
+ typename reduce_unit<unit<D, homogeneous_system<L1> > >::type,
+ typename reduce_unit<unit<D, heterogeneous_system<L2> > >::type
+ >
+{
+ //typedef typename detail::conversion_impl<L2::type::size::value>::template apply<
+ // typename L2::type,
+ // homogeneous_system<L1>
+ //> impl;
+ //typedef eval_scale_list<typename L2::scale> scale;
+ //typedef typename multiply_typeof_helper<typename impl::type, typename scale::type>::type type;
+ //static type value()
+ //{
+ // one numerator;
+ // return(numerator / (impl::value() * scale::value()));
+ //}
+};
+
+/// Requires that all possible conversions
+/// between base units are defined.
+template<class D, class S1, class S2>
+struct conversion_factor_helper<unit<D, heterogeneous_system<S1> >, unit<D, heterogeneous_system<S2> > >
+{
+ /// INTERNAL ONLY
+ typedef typename detail::extract_base_units<S1::type::size::value>::template apply<
+ typename S1::type,
+ dimensionless_type
+ >::type from_base_units;
+ /// INTERNAL ONLY
+ typedef typename detail::extract_base_units<S2::type::size::value>::template apply<
+ typename S2::type,
+ from_base_units
+ >::type all_base_units;
+ /// INTERNAL ONLY
+ typedef typename detail::make_homogeneous_system<all_base_units>::type system;
+ typedef typename detail::conversion_impl<S1::type::size::value>::template apply<
+ typename S1::type,
+ system
+ > conversion1;
+ typedef typename detail::conversion_impl<S2::type::size::value>::template apply<
+ typename S2::type,
+ system
+ > conversion2;
+ typedef eval_scale_list<typename mpl::divides<typename S1::scale, typename S2::scale>::type> scale;
+ typedef typename multiply_typeof_helper<
+ typename conversion1::type,
+ typename divide_typeof_helper<typename scale::type, typename conversion2::type>::type
+ >::type type;
+ static type value()
+ {
+ return(conversion1::value() * (scale::value() / conversion2::value()));
+ }
+};
+
+} // namespace detail
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_CONVERSION_IMPL_HPP
diff --git a/boost/units/detail/dim_impl.hpp b/boost/units/detail/dim_impl.hpp
new file mode 100644
index 0000000..85792b8
--- /dev/null
+++ b/boost/units/detail/dim_impl.hpp
@@ -0,0 +1,90 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_DIM_IMPL_HPP
+#define BOOST_UNITS_DIM_IMPL_HPP
+
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/less.hpp>
+
+#include <boost/units/units_fwd.hpp>
+
+/// \file
+/// \brief Class encapsulating a dimension tag/value pair
+
+namespace boost {
+
+namespace units {
+
+namespace detail {
+
+struct dim_tag;
+
+}
+
+}
+
+namespace mpl {
+
+/// Less than comparison for sorting @c dim.
+template<>
+struct less_impl<boost::units::detail::dim_tag, boost::units::detail::dim_tag>
+{
+ template<class T0, class T1>
+ struct apply : mpl::less<typename T0::tag_type, typename T1::tag_type> {};
+};
+
+}
+
+namespace units {
+
+template<class Tag, class Exponent>
+struct dim;
+
+template<long N, long D>
+class static_rational;
+
+namespace detail {
+
+/// Extract @c tag_type from a @c dim.
+template<typename T>
+struct get_tag
+{
+ typedef typename T::tag_type type;
+};
+
+/// Extract @c value_type from a @c dim.
+template<typename T>
+struct get_value
+{
+ typedef typename T::value_type type;
+};
+
+/// Determine if a @c dim is empty (has a zero exponent).
+template<class T>
+struct is_empty_dim;
+
+template<typename T>
+struct is_empty_dim< dim<T, static_rational<0, 1> > > :
+ mpl::true_
+{ };
+
+template<typename T, typename V>
+struct is_empty_dim< dim<T, V> > :
+ mpl::false_
+{ };
+
+} // namespace detail
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_DIM_IMPL_HPP
diff --git a/boost/units/detail/dimension_impl.hpp b/boost/units/detail/dimension_impl.hpp
new file mode 100644
index 0000000..dbe77af
--- /dev/null
+++ b/boost/units/detail/dimension_impl.hpp
@@ -0,0 +1,347 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_DIMENSION_IMPL_HPP
+#define BOOST_UNITS_DIMENSION_IMPL_HPP
+
+#include <boost/mpl/begin_end.hpp>
+#include <boost/mpl/deref.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/list.hpp>
+#include <boost/mpl/next.hpp>
+#include <boost/mpl/size.hpp>
+#include <boost/mpl/less.hpp>
+
+#include <boost/units/config.hpp>
+#include <boost/units/dimensionless_type.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/units_fwd.hpp>
+#include <boost/units/detail/dimension_list.hpp>
+#include <boost/units/detail/push_front_if.hpp>
+#include <boost/units/detail/push_front_or_add.hpp>
+
+/// \file
+/// \brief Core class and metaprogramming utilities for compile-time dimensional analysis.
+
+namespace boost {
+
+namespace units {
+
+namespace detail {
+
+template<int N>
+struct insertion_sort_dims_insert;
+
+template<bool is_greater>
+struct insertion_sort_dims_comparison_impl;
+
+// have to recursively add the element to the next sequence.
+template<>
+struct insertion_sort_dims_comparison_impl<true> {
+ template<class Begin, int N, class T>
+ struct apply {
+ typedef list<
+ typename Begin::item,
+ typename insertion_sort_dims_insert<N - 1>::template apply<
+ typename Begin::next,
+ T
+ >::type
+ > type;
+ };
+};
+
+// either prepend the current element or join it to
+// the first remaining element of the sequence.
+template<>
+struct insertion_sort_dims_comparison_impl<false> {
+ template<class Begin, int N, class T>
+ struct apply {
+ typedef typename push_front_or_add<Begin, T>::type type;
+ };
+};
+
+template<int N>
+struct insertion_sort_dims_insert {
+ template<class Begin, class T>
+ struct apply {
+ typedef typename insertion_sort_dims_comparison_impl<mpl::less<typename Begin::item, T>::value>::template apply<
+ Begin,
+ N,
+ T
+ >::type type;
+ };
+};
+
+template<>
+struct insertion_sort_dims_insert<0> {
+ template<class Begin, class T>
+ struct apply {
+ typedef list<T, dimensionless_type> type;
+ };
+};
+
+template<int N>
+struct insertion_sort_dims_mpl_sequence {
+ template<class Begin>
+ struct apply {
+ typedef typename insertion_sort_dims_mpl_sequence<N - 1>::template apply<typename mpl::next<Begin>::type>::type next;
+ typedef typename insertion_sort_dims_insert<(next::size::value)>::template apply<next, typename mpl::deref<Begin>::type>::type type;
+ };
+};
+
+template<>
+struct insertion_sort_dims_mpl_sequence<0> {
+ template<class Begin>
+ struct apply {
+ typedef dimensionless_type type;
+ };
+};
+
+template<int N>
+struct insertion_sort_dims_impl {
+ template<class Begin>
+ struct apply {
+ typedef typename insertion_sort_dims_impl<N - 1>::template apply<typename Begin::next>::type next;
+ typedef typename insertion_sort_dims_insert<(next::size::value)>::template apply<next, typename Begin::item>::type type;
+ };
+};
+
+template<>
+struct insertion_sort_dims_impl<0> {
+ template<class Begin>
+ struct apply {
+ typedef dimensionless_type type;
+ };
+};
+
+template<class T>
+struct sort_dims
+{
+ typedef typename insertion_sort_dims_mpl_sequence<mpl::size<T>::value>::template apply<typename mpl::begin<T>::type>::type type;
+};
+
+
+template<class T, class Next>
+struct sort_dims<list<T, Next> >
+{
+ typedef typename insertion_sort_dims_impl<list<T, Next>::size::value>::template apply<list<T, Next> >::type type;
+};
+
+/// sorted sequences can be merged in linear time
+template<bool less, bool greater>
+struct merge_dimensions_func;
+
+template<int N1, int N2>
+struct merge_dimensions_impl;
+
+template<>
+struct merge_dimensions_func<true, false>
+{
+ template<typename Begin1, typename Begin2, int N1, int N2>
+ struct apply
+ {
+ typedef list<
+ typename Begin1::item,
+ typename merge_dimensions_impl<N1 - 1, N2>::template apply<
+ typename Begin1::next,
+ Begin2
+ >::type
+ > type;
+ };
+};
+
+template<>
+struct merge_dimensions_func<false, true> {
+ template<typename Begin1, typename Begin2, int N1, int N2>
+ struct apply
+ {
+ typedef list<
+ typename Begin2::item,
+ typename merge_dimensions_impl<N2 - 1, N1>::template apply<
+ typename Begin2::next,
+ Begin1
+ >::type
+ > type;
+ };
+};
+
+template<>
+struct merge_dimensions_func<false, false> {
+ template<typename Begin1, typename Begin2, int N1, int N2>
+ struct apply
+ {
+ typedef typename mpl::plus<typename Begin1::item, typename Begin2::item>::type combined;
+ typedef typename push_front_if<!is_empty_dim<combined>::value>::template apply<
+ typename merge_dimensions_impl<N1 - 1, N2 - 1>::template apply<
+ typename Begin1::next,
+ typename Begin2::next
+ >::type,
+ combined
+ >::type type;
+ };
+};
+
+template<int N1, int N2>
+struct merge_dimensions_impl {
+ template<typename Begin1, typename Begin2>
+ struct apply
+ {
+ typedef typename Begin1::item dim1;
+ typedef typename Begin2::item dim2;
+
+ typedef typename merge_dimensions_func<(mpl::less<dim1,dim2>::value == true),
+ (mpl::less<dim2,dim1>::value == true)>::template apply<
+ Begin1,
+ Begin2,
+ N1,
+ N2
+ >::type type;
+ };
+};
+
+template<typename Sequence1, typename Sequence2>
+struct merge_dimensions
+{
+ typedef typename detail::merge_dimensions_impl<Sequence1::size::value,
+ Sequence2::size::value>::template
+ apply<
+ Sequence1,
+ Sequence2
+ >::type type;
+};
+
+template<int N>
+struct iterator_to_list
+{
+ template<typename Begin>
+ struct apply
+ {
+ typedef list<
+ typename Begin::item,
+ typename iterator_to_list<N - 1>::template apply<
+ typename Begin::next
+ >::type
+ > type;
+ };
+};
+
+template<>
+struct iterator_to_list<0>
+{
+ template<typename Begin>
+ struct apply {
+ typedef dimensionless_type type;
+ };
+};
+
+template<int N>
+struct merge_dimensions_impl<N, 0>
+{
+ template<typename Begin1, typename Begin2>
+ struct apply
+ {
+ typedef typename iterator_to_list<N>::template apply<Begin1>::type type;
+ };
+};
+
+template<int N>
+struct merge_dimensions_impl<0, N>
+{
+ template<typename Begin1, typename Begin2>
+ struct apply
+ {
+ typedef typename iterator_to_list<N>::template apply<Begin2>::type type;
+ };
+};
+
+template<>
+struct merge_dimensions_impl<0, 0>
+{
+ template<typename Begin1, typename Begin2>
+ struct apply
+ {
+ typedef dimensionless_type type;
+ };
+};
+
+template<int N>
+struct static_inverse_impl
+{
+ template<typename Begin>
+ struct apply {
+ typedef list<
+ typename mpl::negate<typename Begin::item>::type,
+ typename static_inverse_impl<N - 1>::template apply<
+ typename Begin::next
+ >::type
+ > type;
+ };
+};
+
+template<>
+struct static_inverse_impl<0>
+{
+ template<typename Begin>
+ struct apply
+ {
+ typedef dimensionless_type type;
+ };
+};
+
+template<int N>
+struct static_power_impl
+{
+ template<typename Begin, typename Ex>
+ struct apply
+ {
+ typedef list<
+ typename mpl::times<typename Begin::item, Ex>::type,
+ typename detail::static_power_impl<N - 1>::template apply<typename Begin::next, Ex>::type
+ > type;
+ };
+};
+
+template<>
+struct static_power_impl<0>
+{
+ template<typename Begin, typename Ex>
+ struct apply
+ {
+ typedef dimensionless_type type;
+ };
+};
+
+template<int N>
+struct static_root_impl {
+ template<class Begin, class Ex>
+ struct apply {
+ typedef list<
+ typename mpl::divides<typename Begin::item, Ex>::type,
+ typename detail::static_root_impl<N - 1>::template apply<typename Begin::next, Ex>::type
+ > type;
+ };
+};
+
+template<>
+struct static_root_impl<0> {
+ template<class Begin, class Ex>
+ struct apply
+ {
+ typedef dimensionless_type type;
+ };
+};
+
+} // namespace detail
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_DIMENSION_IMPL_HPP
diff --git a/boost/units/detail/dimension_list.hpp b/boost/units/detail/dimension_list.hpp
new file mode 100644
index 0000000..fc05547
--- /dev/null
+++ b/boost/units/detail/dimension_list.hpp
@@ -0,0 +1,133 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_DIMENSION_LIST_HPP
+#define BOOST_UNITS_DIMENSION_LIST_HPP
+
+#include <boost/mpl/next.hpp>
+#include <boost/mpl/deref.hpp>
+#include <boost/mpl/push_front_fwd.hpp>
+#include <boost/mpl/pop_front_fwd.hpp>
+#include <boost/mpl/size_fwd.hpp>
+#include <boost/mpl/begin_end_fwd.hpp>
+#include <boost/mpl/front_fwd.hpp>
+
+#include <boost/units/config.hpp>
+
+namespace boost {
+
+namespace units {
+
+struct dimensionless_type;
+
+namespace detail {
+
+struct dimension_list_tag { };
+
+} // namespace detail
+
+template<class Item, class Next>
+struct list
+{
+ typedef detail::dimension_list_tag tag;
+ typedef list type;
+ typedef Item item;
+ typedef Next next;
+ typedef typename mpl::next<typename Next::size>::type size;
+};
+
+} // namespace units
+
+namespace mpl {
+
+// INTERNAL ONLY
+template<>
+struct size_impl<units::detail::dimension_list_tag>
+{
+ template<class L> struct apply : public L::size { };
+};
+
+// INTERNAL ONLY
+template<>
+struct begin_impl<units::detail::dimension_list_tag>
+{
+ template<class L>
+ struct apply
+ {
+ typedef L type;
+ };
+};
+
+// INTERNAL ONLY
+template<>
+struct end_impl<units::detail::dimension_list_tag>
+{
+ template<class L>
+ struct apply
+ {
+ typedef units::dimensionless_type type;
+ };
+};
+
+// INTERNAL ONLY
+template<>
+struct push_front_impl<units::detail::dimension_list_tag>
+{
+ template<class L, class T>
+ struct apply
+ {
+ typedef units::list<T, L> type;
+ };
+};
+
+// INTERNAL ONLY
+template<>
+struct pop_front_impl<units::detail::dimension_list_tag>
+{
+ template<class L>
+ struct apply
+ {
+ typedef typename L::next type;
+ };
+};
+
+// INTERNAL ONLY
+template<>
+struct front_impl<units::detail::dimension_list_tag>
+{
+ template<class L>
+ struct apply
+ {
+ typedef typename L::item type;
+ };
+};
+
+// INTERNAL ONLY
+template<class Item, class Next>
+struct deref<units::list<Item, Next> >
+{
+ typedef Item type;
+};
+
+} // namespace mpl
+
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::list, 2)
+
+#endif
+
+#include <boost/units/dimensionless_type.hpp>
+
+#endif // BOOST_UNITS_DIMENSION_LIST_HPP
diff --git a/boost/units/detail/dimensionless_unit.hpp b/boost/units/detail/dimensionless_unit.hpp
new file mode 100644
index 0000000..291bec4
--- /dev/null
+++ b/boost/units/detail/dimensionless_unit.hpp
@@ -0,0 +1,88 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_DETAIL_DIMENSIONLESS_UNIT_HPP
+#define BOOST_UNITS_DETAIL_DIMENSIONLESS_UNIT_HPP
+
+#include <boost/mpl/bool.hpp>
+#include <boost/units/units_fwd.hpp>
+
+namespace boost {
+namespace units {
+
+template<class T>
+struct heterogeneous_system;
+
+template<class T>
+struct homogeneous_system;
+
+template<class T1, class T2, class Scale>
+struct heterogeneous_system_impl;
+
+typedef boost::units::heterogeneous_system<
+ boost::units::heterogeneous_system_impl<
+ boost::units::dimensionless_type,
+ boost::units::dimensionless_type,
+ boost::units::dimensionless_type
+ >
+> heterogeneous_dimensionless_system;
+
+namespace detail {
+
+template<class System>
+struct void_if_dimensionless {
+ typedef int type;
+};
+
+template<class T>
+struct void_if_dimensionless<boost::units::homogeneous_system<T> > {
+ typedef void type;
+};
+
+template<>
+struct void_if_dimensionless<heterogeneous_dimensionless_system> {
+ typedef void type;
+};
+
+template<class System, class Test = void>
+struct void_if_heterogeneous {
+ typedef void type;
+};
+
+template<class System>
+struct void_if_heterogeneous<System, typename void_if_dimensionless<System>::type> {
+ typedef int type;
+};
+
+template<class System, class Enable=void>
+struct is_dimensionless_system : mpl::false_ {};
+
+template<class System>
+struct is_dimensionless_system<System, typename void_if_dimensionless<System>::type> : mpl::true_ {};
+
+#define BOOST_UNITS_DIMENSIONLESS_UNIT(T)\
+ boost::units::unit<\
+ boost::units::dimensionless_type,\
+ T,\
+ typename ::boost::units::detail::void_if_dimensionless<T>::type\
+ >
+
+#define BOOST_UNITS_HETEROGENEOUS_DIMENSIONLESS_UNIT(T)\
+ boost::units::unit<\
+ boost::units::dimensionless_type,\
+ T,\
+ typename ::boost::units::detail::void_if_heterogeneous<T>::type\
+ >
+
+}
+}
+}
+
+#endif
diff --git a/boost/units/detail/heterogeneous_conversion.hpp b/boost/units/detail/heterogeneous_conversion.hpp
new file mode 100644
index 0000000..bfdf987
--- /dev/null
+++ b/boost/units/detail/heterogeneous_conversion.hpp
@@ -0,0 +1,309 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_DETAIL_HETEROGENEOUS_CONVERSION_HPP
+#define BOOST_UNITS_DETAIL_HETEROGENEOUS_CONVERSION_HPP
+
+#include <boost/mpl/minus.hpp>
+#include <boost/mpl/times.hpp>
+
+#include <boost/units/static_rational.hpp>
+#include <boost/units/homogeneous_system.hpp>
+#include <boost/units/detail/linear_algebra.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace detail {
+
+struct solve_end {
+ template<class Begin, class Y>
+ struct apply {
+ typedef dimensionless_type type;
+ };
+};
+
+struct no_solution {};
+
+template<class X1, class X2, class Next>
+struct solve_normal {
+ template<class Begin, class Y>
+ struct apply {
+ typedef typename Begin::next next;
+ typedef list<
+ typename mpl::minus<
+ typename mpl::times<X1, Y>::type,
+ typename mpl::times<X2, typename Begin::item>::type
+ >::type,
+ typename Next::template apply<next, Y>::type
+ > type;
+ };
+};
+
+template<class Next>
+struct solve_leading_zeroes {
+ template<class Begin>
+ struct apply {
+ typedef list<
+ typename Begin::item,
+ typename Next::template apply<typename Begin::next>::type
+ > type;
+ };
+ typedef solve_leading_zeroes type;
+};
+
+template<>
+struct solve_leading_zeroes<no_solution> {
+ typedef no_solution type;
+};
+
+template<class Next>
+struct solve_first_non_zero {
+ template<class Begin>
+ struct apply {
+ typedef typename Next::template apply<
+ typename Begin::next,
+ typename Begin::item
+ >::type type;
+ };
+};
+
+template<class Next>
+struct solve_internal_zero {
+ template<class Begin, class Y>
+ struct apply {
+ typedef list<
+ typename Begin::item,
+ typename Next::template apply<typename Begin::next, Y>::type
+ > type;
+ };
+};
+
+template<class T>
+struct make_solve_list_internal_zero {
+ template<class Next, class X>
+ struct apply {
+ typedef solve_normal<T, X, Next> type;
+ };
+};
+
+template<>
+struct make_solve_list_internal_zero<static_rational<0> > {
+ template<class Next, class X>
+ struct apply {
+ typedef solve_internal_zero<Next> type;
+ };
+};
+
+template<int N>
+struct make_solve_list_normal {
+ template<class Begin, class X>
+ struct apply {
+ typedef typename make_solve_list_internal_zero<
+ typename Begin::item
+ >::template apply<
+ typename make_solve_list_normal<N-1>::template apply<typename Begin::next, X>::type,
+ X
+ >::type type;
+ };
+};
+
+template<>
+struct make_solve_list_normal<0> {
+ template<class Begin, class X>
+ struct apply {
+ typedef solve_end type;
+ };
+};
+
+template<int N>
+struct make_solve_list_leading_zeroes;
+
+template<class T>
+struct make_solve_list_first_non_zero {
+ template<class Begin, int N>
+ struct apply {
+ typedef solve_first_non_zero<
+ typename make_solve_list_normal<N-1>::template apply<
+ typename Begin::next,
+ typename Begin::item
+ >::type
+ > type;
+ };
+};
+
+template<>
+struct make_solve_list_first_non_zero<static_rational<0> > {
+ template<class Begin, int N>
+ struct apply {
+ typedef typename solve_leading_zeroes<
+ typename make_solve_list_leading_zeroes<N-1>::template apply<
+ typename Begin::next
+ >::type
+ >::type type;
+ };
+};
+
+template<int N>
+struct make_solve_list_leading_zeroes {
+ template<class Begin>
+ struct apply {
+ typedef typename make_solve_list_first_non_zero<typename Begin::item>::template apply<Begin, N>::type type;
+ };
+};
+
+template<>
+struct make_solve_list_leading_zeroes<0> {
+ template<class Begin>
+ struct apply {
+ typedef no_solution type;
+ };
+};
+
+template<int N>
+struct try_add_unit_impl {
+ template<class Begin, class L>
+ struct apply {
+ typedef typename try_add_unit_impl<N-1>::template apply<typename Begin::next, L>::type next;
+ typedef typename Begin::item::template apply<next>::type type;
+ BOOST_STATIC_ASSERT((next::size::value - 1 == type::size::value));
+ };
+};
+
+template<>
+struct try_add_unit_impl<0> {
+ template<class Begin, class L>
+ struct apply {
+ typedef L type;
+ };
+};
+
+template<int N>
+struct make_homogeneous_system_impl;
+
+template<class T, bool is_done>
+struct make_homogeneous_system_func;
+
+template<class T>
+struct make_homogeneous_system_func<T, false> {
+ template<class Begin, class Current, class Units, class Dimensions, int N>
+ struct apply {
+ typedef typename make_homogeneous_system_impl<N-1>::template apply<
+ typename Begin::next,
+ list<T, Current>,
+ list<typename Begin::item, Units>,
+ Dimensions
+ >::type type;
+ };
+};
+
+template<class T>
+struct make_homogeneous_system_func<T, true> {
+ template<class Begin, class Current, class Units, class Dimensions, int N>
+ struct apply {
+ typedef list<typename Begin::item, Units> type;
+ };
+};
+
+template<>
+struct make_homogeneous_system_func<no_solution, false> {
+ template<class Begin, class Current, class Units, class Dimensions, int N>
+ struct apply {
+ typedef typename make_homogeneous_system_impl<N-1>::template apply<
+ typename Begin::next,
+ Current,
+ Units,
+ Dimensions
+ >::type type;
+ };
+};
+
+template<>
+struct make_homogeneous_system_func<no_solution, true> {
+ template<class Begin, class Current, class Units, class Dimensions, int N>
+ struct apply {
+ typedef typename make_homogeneous_system_impl<N-1>::template apply<
+ typename Begin::next,
+ Current,
+ Units,
+ Dimensions
+ >::type type;
+ };
+};
+
+template<int N>
+struct make_homogeneous_system_impl {
+ template<class Begin, class Current, class Units, class Dimensions>
+ struct apply {
+ typedef typename expand_dimensions<Dimensions::size::value>::template apply<
+ Dimensions,
+ typename Begin::item::dimension_type
+ >::type dimensions;
+ typedef typename try_add_unit_impl<Current::size::value>::template apply<Current, dimensions>::type new_element;
+ typedef typename make_solve_list_leading_zeroes<new_element::size::value>::template apply<new_element>::type new_func;
+ typedef typename make_homogeneous_system_func<
+ new_func,
+ ((Current::size::value)+1) == (Dimensions::size::value)
+ >::template apply<Begin, Current, Units, Dimensions, N>::type type;
+ };
+};
+
+template<>
+struct make_homogeneous_system_impl<0> {
+ template<class Begin, class Current, class Units, class Dimensions>
+ struct apply {
+ typedef Units type;
+ };
+};
+
+template<class Units>
+struct make_homogeneous_system {
+ typedef typename find_base_dimensions<Units>::type base_dimensions;
+ typedef homogeneous_system<
+ typename insertion_sort<
+ typename make_homogeneous_system_impl<
+ Units::size::value
+ >::template apply<
+ Units,
+ dimensionless_type,
+ dimensionless_type,
+ base_dimensions
+ >::type
+ >::type
+ > type;
+};
+
+template<int N>
+struct extract_base_units {
+ template<class Begin, class T>
+ struct apply {
+ typedef list<
+ typename Begin::item::tag_type,
+ typename extract_base_units<N-1>::template apply<typename Begin::next, T>::type
+ > type;
+ };
+};
+
+template<>
+struct extract_base_units<0> {
+ template<class Begin, class T>
+ struct apply {
+ typedef T type;
+ };
+};
+
+}
+
+}
+
+}
+
+#endif
diff --git a/boost/units/detail/linear_algebra.hpp b/boost/units/detail/linear_algebra.hpp
new file mode 100644
index 0000000..20964a9
--- /dev/null
+++ b/boost/units/detail/linear_algebra.hpp
@@ -0,0 +1,1060 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_DETAIL_LINEAR_ALGEBRA_HPP
+#define BOOST_UNITS_DETAIL_LINEAR_ALGEBRA_HPP
+
+#include <boost/units/static_rational.hpp>
+#include <boost/mpl/next.hpp>
+#include <boost/mpl/arithmetic.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/assert.hpp>
+
+#include <boost/units/dim.hpp>
+#include <boost/units/dimensionless_type.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/detail/dimension_list.hpp>
+#include <boost/units/detail/sort.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace detail {
+
+// typedef list<rational> equation;
+
+template<int N>
+struct eliminate_from_pair_of_equations_impl;
+
+template<class E1, class E2>
+struct eliminate_from_pair_of_equations;
+
+template<int N>
+struct elimination_impl;
+
+template<bool is_zero, bool element_is_last>
+struct elimination_skip_leading_zeros_impl;
+
+template<class Equation, class Vars>
+struct substitute;
+
+template<int N>
+struct substitute_impl;
+
+template<bool is_end>
+struct solve_impl;
+
+template<class T>
+struct solve;
+
+template<int N>
+struct check_extra_equations_impl;
+
+template<int N>
+struct normalize_units_impl;
+
+struct inconsistent {};
+
+// generally useful utilies.
+
+template<int N>
+struct divide_equation {
+ template<class Begin, class Divisor>
+ struct apply {
+ typedef list<typename mpl::divides<typename Begin::item, Divisor>::type, typename divide_equation<N - 1>::template apply<typename Begin::next, Divisor>::type> type;
+ };
+};
+
+template<>
+struct divide_equation<0> {
+ template<class Begin, class Divisor>
+ struct apply {
+ typedef dimensionless_type type;
+ };
+};
+
+// eliminate_from_pair_of_equations takes a pair of
+// equations and eliminates the first variable.
+//
+// equation eliminate_from_pair_of_equations(equation l1, equation l2) {
+// rational x1 = l1.front();
+// rational x2 = l2.front();
+// return(transform(pop_front(l1), pop_front(l2), _1 * x2 - _2 * x1));
+// }
+
+template<int N>
+struct eliminate_from_pair_of_equations_impl {
+ template<class Begin1, class Begin2, class X1, class X2>
+ struct apply {
+ typedef list<
+ typename mpl::minus<
+ typename mpl::times<typename Begin1::item, X2>::type,
+ typename mpl::times<typename Begin2::item, X1>::type
+ >::type,
+ typename eliminate_from_pair_of_equations_impl<N - 1>::template apply<
+ typename Begin1::next,
+ typename Begin2::next,
+ X1,
+ X2
+ >::type
+ > type;
+ };
+};
+
+template<>
+struct eliminate_from_pair_of_equations_impl<0> {
+ template<class Begin1, class Begin2, class X1, class X2>
+ struct apply {
+ typedef dimensionless_type type;
+ };
+};
+
+template<class E1, class E2>
+struct eliminate_from_pair_of_equations {
+ typedef E1 begin1;
+ typedef E2 begin2;
+ typedef typename eliminate_from_pair_of_equations_impl<(E1::size::value - 1)>::template apply<
+ typename begin1::next,
+ typename begin2::next,
+ typename begin1::item,
+ typename begin2::item
+ >::type type;
+};
+
+
+
+// Stage 1. Determine which dimensions should
+// have dummy base units. For this purpose
+// row reduce the matrix.
+
+template<int N>
+struct make_zero_vector {
+ typedef list<static_rational<0>, typename make_zero_vector<N - 1>::type> type;
+};
+template<>
+struct make_zero_vector<0> {
+ typedef dimensionless_type type;
+};
+
+template<int Column, int TotalColumns>
+struct create_row_of_identity {
+ typedef list<static_rational<0>, typename create_row_of_identity<Column - 1, TotalColumns - 1>::type> type;
+};
+template<int TotalColumns>
+struct create_row_of_identity<0, TotalColumns> {
+ typedef list<static_rational<1>, typename make_zero_vector<TotalColumns - 1>::type> type;
+};
+template<int Column>
+struct create_row_of_identity<Column, 0> {
+ // error
+};
+
+template<int RemainingRows>
+struct determine_extra_equations_impl;
+
+template<bool first_is_zero, bool is_last>
+struct determine_extra_equations_skip_zeros_impl;
+
+// not the last row and not zero.
+template<>
+struct determine_extra_equations_skip_zeros_impl<false, false> {
+ template<class RowsBegin, int RemainingRows, int CurrentColumn, int TotalColumns, class Result>
+ struct apply {
+ // remove the equation being eliminated against from the set of equations.
+ typedef typename determine_extra_equations_impl<RemainingRows - 1>::template apply<typename RowsBegin::next, typename RowsBegin::item>::type next_equations;
+ // since this column was present, strip it out.
+ typedef Result type;
+ };
+};
+
+// the last row but not zero.
+template<>
+struct determine_extra_equations_skip_zeros_impl<false, true> {
+ template<class RowsBegin, int RemainingRows, int CurrentColumn, int TotalColumns, class Result>
+ struct apply {
+ // remove this equation.
+ typedef dimensionless_type next_equations;
+ // since this column was present, strip it out.
+ typedef Result type;
+ };
+};
+
+
+// the first columns is zero but it is not the last column.
+// continue with the same loop.
+template<>
+struct determine_extra_equations_skip_zeros_impl<true, false> {
+ template<class RowsBegin, int RemainingRows, int CurrentColumn, int TotalColumns, class Result>
+ struct apply {
+ typedef typename RowsBegin::next::item next_row;
+ typedef typename determine_extra_equations_skip_zeros_impl<
+ next_row::item::Numerator == 0,
+ RemainingRows == 2 // the next one will be the last.
+ >::template apply<
+ typename RowsBegin::next,
+ RemainingRows - 1,
+ CurrentColumn,
+ TotalColumns,
+ Result
+ > next;
+ typedef list<typename RowsBegin::item::next, typename next::next_equations> next_equations;
+ typedef typename next::type type;
+ };
+};
+
+// all the elements in this column are zero.
+template<>
+struct determine_extra_equations_skip_zeros_impl<true, true> {
+ template<class RowsBegin, int RemainingRows, int CurrentColumn, int TotalColumns, class Result>
+ struct apply {
+ typedef list<typename RowsBegin::item::next, dimensionless_type> next_equations;
+ typedef list<typename create_row_of_identity<CurrentColumn, TotalColumns>::type, Result> type;
+ };
+};
+
+template<int RemainingRows>
+struct determine_extra_equations_impl {
+ template<class RowsBegin, class EliminateAgainst>
+ struct apply {
+ typedef list<
+ typename eliminate_from_pair_of_equations<typename RowsBegin::item, EliminateAgainst>::type,
+ typename determine_extra_equations_impl<RemainingRows-1>::template apply<typename RowsBegin::next, EliminateAgainst>::type
+ > type;
+ };
+};
+
+template<>
+struct determine_extra_equations_impl<0> {
+ template<class RowsBegin, class EliminateAgainst>
+ struct apply {
+ typedef dimensionless_type type;
+ };
+};
+
+template<int RemainingColumns, bool is_done>
+struct determine_extra_equations {
+ template<class RowsBegin, int TotalColumns, class Result>
+ struct apply {
+ typedef typename RowsBegin::item top_row;
+ typedef typename determine_extra_equations_skip_zeros_impl<
+ top_row::item::Numerator == 0,
+ RowsBegin::item::size::value == 1
+ >::template apply<
+ RowsBegin,
+ RowsBegin::size::value,
+ TotalColumns - RemainingColumns,
+ TotalColumns,
+ Result
+ > column_info;
+ typedef typename determine_extra_equations<
+ RemainingColumns - 1,
+ column_info::next_equations::size::value == 0
+ >::template apply<
+ typename column_info::next_equations,
+ TotalColumns,
+ typename column_info::type
+ >::type type;
+ };
+};
+
+template<int RemainingColumns>
+struct determine_extra_equations<RemainingColumns, true> {
+ template<class RowsBegin, int TotalColumns, class Result>
+ struct apply {
+ typedef typename determine_extra_equations<RemainingColumns - 1, true>::template apply<
+ RowsBegin,
+ TotalColumns,
+ list<typename create_row_of_identity<TotalColumns - RemainingColumns, TotalColumns>::type, Result>
+ >::type type;
+ };
+};
+
+template<>
+struct determine_extra_equations<0, true> {
+ template<class RowsBegin, int TotalColumns, class Result>
+ struct apply {
+ typedef Result type;
+ };
+};
+
+// Stage 2
+// invert the matrix using Gauss-Jordan elimination
+
+
+template<bool is_zero, bool is_last>
+struct invert_strip_leading_zeroes;
+
+template<int N>
+struct invert_handle_after_pivot_row;
+
+// When processing column N, none of the first N rows
+// can be the pivot column.
+template<int N>
+struct invert_handle_inital_rows {
+ template<class RowsBegin, class IdentityBegin>
+ struct apply {
+ typedef typename invert_handle_inital_rows<N - 1>::template apply<
+ typename RowsBegin::next,
+ typename IdentityBegin::next
+ > next;
+ typedef typename RowsBegin::item current_row;
+ typedef typename IdentityBegin::item current_identity_row;
+ typedef typename next::pivot_row pivot_row;
+ typedef typename next::identity_pivot_row identity_pivot_row;
+ typedef list<
+ typename eliminate_from_pair_of_equations_impl<(current_row::size::value) - 1>::template apply<
+ typename current_row::next,
+ pivot_row,
+ typename current_row::item,
+ static_rational<1>
+ >::type,
+ typename next::new_matrix
+ > new_matrix;
+ typedef list<
+ typename eliminate_from_pair_of_equations_impl<(current_identity_row::size::value)>::template apply<
+ current_identity_row,
+ identity_pivot_row,
+ typename current_row::item,
+ static_rational<1>
+ >::type,
+ typename next::identity_result
+ > identity_result;
+ };
+};
+
+// This handles the switch to searching for a pivot column.
+// The pivot row will be propagated up in the typedefs
+// pivot_row and identity_pivot_row. It is inserted here.
+template<>
+struct invert_handle_inital_rows<0> {
+ template<class RowsBegin, class IdentityBegin>
+ struct apply {
+ typedef typename RowsBegin::item current_row;
+ typedef typename invert_strip_leading_zeroes<
+ (current_row::item::Numerator == 0),
+ (RowsBegin::size::value == 1)
+ >::template apply<
+ RowsBegin,
+ IdentityBegin
+ > next;
+ // results
+ typedef list<typename next::pivot_row, typename next::new_matrix> new_matrix;
+ typedef list<typename next::identity_pivot_row, typename next::identity_result> identity_result;
+ typedef typename next::pivot_row pivot_row;
+ typedef typename next::identity_pivot_row identity_pivot_row;
+ };
+};
+
+// The first internal element which is not zero.
+template<>
+struct invert_strip_leading_zeroes<false, false> {
+ template<class RowsBegin, class IdentityBegin>
+ struct apply {
+ typedef typename RowsBegin::item current_row;
+ typedef typename current_row::item current_value;
+ typedef typename divide_equation<(current_row::size::value - 1)>::template apply<typename current_row::next, current_value>::type new_equation;
+ typedef typename divide_equation<(IdentityBegin::item::size::value)>::template apply<typename IdentityBegin::item, current_value>::type transformed_identity_equation;
+ typedef typename invert_handle_after_pivot_row<(RowsBegin::size::value - 1)>::template apply<
+ typename RowsBegin::next,
+ typename IdentityBegin::next,
+ new_equation,
+ transformed_identity_equation
+ > next;
+
+ // results
+ // Note that we don't add the pivot row to the
+ // results here, because it needs to propagated up
+ // to the diagonal.
+ typedef typename next::new_matrix new_matrix;
+ typedef typename next::identity_result identity_result;
+ typedef new_equation pivot_row;
+ typedef transformed_identity_equation identity_pivot_row;
+ };
+};
+
+// The one and only non-zero element--at the end
+template<>
+struct invert_strip_leading_zeroes<false, true> {
+ template<class RowsBegin, class IdentityBegin>
+ struct apply {
+ typedef typename RowsBegin::item current_row;
+ typedef typename current_row::item current_value;
+ typedef typename divide_equation<(current_row::size::value - 1)>::template apply<typename current_row::next, current_value>::type new_equation;
+ typedef typename divide_equation<(IdentityBegin::item::size::value)>::template apply<typename IdentityBegin::item, current_value>::type transformed_identity_equation;
+
+ // results
+ // Note that we don't add the pivot row to the
+ // results here, because it needs to propagated up
+ // to the diagonal.
+ typedef dimensionless_type identity_result;
+ typedef dimensionless_type new_matrix;
+ typedef new_equation pivot_row;
+ typedef transformed_identity_equation identity_pivot_row;
+ };
+};
+
+// One of the initial zeroes
+template<>
+struct invert_strip_leading_zeroes<true, false> {
+ template<class RowsBegin, class IdentityBegin>
+ struct apply {
+ typedef typename RowsBegin::item current_row;
+ typedef typename RowsBegin::next::item next_row;
+ typedef typename invert_strip_leading_zeroes<
+ next_row::item::Numerator == 0,
+ RowsBegin::size::value == 2
+ >::template apply<
+ typename RowsBegin::next,
+ typename IdentityBegin::next
+ > next;
+ typedef typename IdentityBegin::item current_identity_row;
+ // these are propagated up.
+ typedef typename next::pivot_row pivot_row;
+ typedef typename next::identity_pivot_row identity_pivot_row;
+ typedef list<
+ typename eliminate_from_pair_of_equations_impl<(current_row::size::value - 1)>::template apply<
+ typename current_row::next,
+ pivot_row,
+ typename current_row::item,
+ static_rational<1>
+ >::type,
+ typename next::new_matrix
+ > new_matrix;
+ typedef list<
+ typename eliminate_from_pair_of_equations_impl<(current_identity_row::size::value)>::template apply<
+ current_identity_row,
+ identity_pivot_row,
+ typename current_row::item,
+ static_rational<1>
+ >::type,
+ typename next::identity_result
+ > identity_result;
+ };
+};
+
+// the last element, and is zero.
+// Should never happen.
+template<>
+struct invert_strip_leading_zeroes<true, true> {
+};
+
+template<int N>
+struct invert_handle_after_pivot_row {
+ template<class RowsBegin, class IdentityBegin, class MatrixPivot, class IdentityPivot>
+ struct apply {
+ typedef typename invert_handle_after_pivot_row<N - 1>::template apply<
+ typename RowsBegin::next,
+ typename IdentityBegin::next,
+ MatrixPivot,
+ IdentityPivot
+ > next;
+ typedef typename RowsBegin::item current_row;
+ typedef typename IdentityBegin::item current_identity_row;
+ typedef MatrixPivot pivot_row;
+ typedef IdentityPivot identity_pivot_row;
+
+ // results
+ typedef list<
+ typename eliminate_from_pair_of_equations_impl<(current_row::size::value - 1)>::template apply<
+ typename current_row::next,
+ pivot_row,
+ typename current_row::item,
+ static_rational<1>
+ >::type,
+ typename next::new_matrix
+ > new_matrix;
+ typedef list<
+ typename eliminate_from_pair_of_equations_impl<(current_identity_row::size::value)>::template apply<
+ current_identity_row,
+ identity_pivot_row,
+ typename current_row::item,
+ static_rational<1>
+ >::type,
+ typename next::identity_result
+ > identity_result;
+ };
+};
+
+template<>
+struct invert_handle_after_pivot_row<0> {
+ template<class RowsBegin, class IdentityBegin, class MatrixPivot, class IdentityPivot>
+ struct apply {
+ typedef dimensionless_type new_matrix;
+ typedef dimensionless_type identity_result;
+ };
+};
+
+template<int N>
+struct invert_impl {
+ template<class RowsBegin, class IdentityBegin>
+ struct apply {
+ typedef typename invert_handle_inital_rows<RowsBegin::size::value - N>::template apply<RowsBegin, IdentityBegin> process_column;
+ typedef typename invert_impl<N - 1>::template apply<
+ typename process_column::new_matrix,
+ typename process_column::identity_result
+ >::type type;
+ };
+};
+
+template<>
+struct invert_impl<0> {
+ template<class RowsBegin, class IdentityBegin>
+ struct apply {
+ typedef IdentityBegin type;
+ };
+};
+
+template<int N>
+struct make_identity {
+ template<int Size>
+ struct apply {
+ typedef list<typename create_row_of_identity<Size - N, Size>::type, typename make_identity<N - 1>::template apply<Size>::type> type;
+ };
+};
+
+template<>
+struct make_identity<0> {
+ template<int Size>
+ struct apply {
+ typedef dimensionless_type type;
+ };
+};
+
+template<class Matrix>
+struct make_square_and_invert {
+ typedef typename Matrix::item top_row;
+ typedef typename determine_extra_equations<(top_row::size::value), false>::template apply<
+ Matrix, // RowsBegin
+ top_row::size::value, // TotalColumns
+ Matrix // Result
+ >::type invertible;
+ typedef typename invert_impl<invertible::size::value>::template apply<
+ invertible,
+ typename make_identity<invertible::size::value>::template apply<invertible::size::value>::type
+ >::type type;
+};
+
+
+// find_base_dimensions takes a list of
+// base_units and returns a sorted list
+// of all the base_dimensions they use.
+//
+// list<base_dimension> find_base_dimensions(list<base_unit> l) {
+// set<base_dimension> dimensions;
+// for_each(base_unit unit : l) {
+// for_each(dim d : unit.dimension_type) {
+// dimensions = insert(dimensions, d.tag_type);
+// }
+// }
+// return(sort(dimensions, _1 > _2, front_inserter(list<base_dimension>())));
+// }
+
+typedef char set_no;
+struct set_yes { set_no dummy[2]; };
+
+template<class T>
+struct wrap {};
+
+struct set_end {
+ static set_no lookup(...);
+ typedef mpl::long_<0> size;
+};
+
+template<class T, class Next>
+struct set : Next {
+ using Next::lookup;
+ static set_yes lookup(wrap<T>*);
+ typedef T item;
+ typedef Next next;
+ typedef typename mpl::next<typename Next::size>::type size;
+};
+
+template<bool has_key>
+struct set_insert;
+
+template<>
+struct set_insert<true> {
+ template<class Set, class T>
+ struct apply {
+ typedef Set type;
+ };
+};
+
+template<>
+struct set_insert<false> {
+ template<class Set, class T>
+ struct apply {
+ typedef set<T, Set> type;
+ };
+};
+
+template<class Set, class T>
+struct has_key {
+ static const long size = sizeof(Set::lookup((wrap<T>*)0));
+ static const bool value = (size == sizeof(set_yes));
+};
+
+template<int N>
+struct find_base_dimensions_impl_impl {
+ template<class Begin, class S>
+ struct apply {
+ typedef typename find_base_dimensions_impl_impl<N-1>::template apply<
+ typename Begin::next,
+ S
+ >::type next;
+
+ typedef typename set_insert<
+ (has_key<next, typename Begin::item::tag_type>::value)
+ >::template apply<
+ next,
+ typename Begin::item::tag_type
+ >::type type;
+ };
+};
+
+template<>
+struct find_base_dimensions_impl_impl<0> {
+ template<class Begin, class S>
+ struct apply {
+ typedef S type;
+ };
+};
+
+template<int N>
+struct find_base_dimensions_impl {
+ template<class Begin>
+ struct apply {
+ typedef typename find_base_dimensions_impl_impl<(Begin::item::dimension_type::size::value)>::template apply<
+ typename Begin::item::dimension_type,
+ typename find_base_dimensions_impl<N-1>::template apply<typename Begin::next>::type
+ >::type type;
+ };
+};
+
+template<>
+struct find_base_dimensions_impl<0> {
+ template<class Begin>
+ struct apply {
+ typedef set_end type;
+ };
+};
+
+template<class T>
+struct find_base_dimensions {
+ typedef typename insertion_sort<
+ typename find_base_dimensions_impl<
+ (T::size::value)
+ >::template apply<T>::type
+ >::type type;
+};
+
+// calculate_base_dimension_coefficients finds
+// the coefficients corresponding to the first
+// base_dimension in each of the dimension_lists.
+// It returns two values. The first result
+// is a list of the coefficients. The second
+// is a list with all the incremented iterators.
+// When we encounter a base_dimension that is
+// missing from a dimension_list, we do not
+// increment the iterator and we set the
+// coefficient to zero.
+
+template<bool has_dimension>
+struct calculate_base_dimension_coefficients_func;
+
+template<>
+struct calculate_base_dimension_coefficients_func<true> {
+ template<class T>
+ struct apply {
+ typedef typename T::item::value_type type;
+ typedef typename T::next next;
+ };
+};
+
+template<>
+struct calculate_base_dimension_coefficients_func<false> {
+ template<class T>
+ struct apply {
+ typedef static_rational<0> type;
+ typedef T next;
+ };
+};
+
+// begins_with_dimension returns true iff its first
+// parameter is a valid iterator which yields its
+// second parameter when dereferenced.
+
+template<class Iterator>
+struct begins_with_dimension {
+ template<class Dim>
+ struct apply :
+ boost::is_same<
+ Dim,
+ typename Iterator::item::tag_type
+ > {};
+};
+
+template<>
+struct begins_with_dimension<dimensionless_type> {
+ template<class Dim>
+ struct apply : mpl::false_ {};
+};
+
+template<int N>
+struct calculate_base_dimension_coefficients_impl {
+ template<class BaseUnitDimensions,class Dim,class T>
+ struct apply {
+ typedef typename calculate_base_dimension_coefficients_func<
+ begins_with_dimension<typename BaseUnitDimensions::item>::template apply<
+ Dim
+ >::value
+ >::template apply<
+ typename BaseUnitDimensions::item
+ > result;
+ typedef typename calculate_base_dimension_coefficients_impl<N-1>::template apply<
+ typename BaseUnitDimensions::next,
+ Dim,
+ list<typename result::type, T>
+ > next_;
+ typedef typename next_::type type;
+ typedef list<typename result::next, typename next_::next> next;
+ };
+};
+
+template<>
+struct calculate_base_dimension_coefficients_impl<0> {
+ template<class Begin, class BaseUnitDimensions, class T>
+ struct apply {
+ typedef T type;
+ typedef dimensionless_type next;
+ };
+};
+
+// add_zeroes pushs N zeroes onto the
+// front of a list.
+//
+// list<rational> add_zeroes(list<rational> l, int N) {
+// if(N == 0) {
+// return(l);
+// } else {
+// return(push_front(add_zeroes(l, N-1), 0));
+// }
+// }
+
+template<int N>
+struct add_zeroes_impl {
+ // If you get an error here and your base units are
+ // in fact linearly independent, please report it.
+ BOOST_MPL_ASSERT_MSG((N > 0), base_units_are_probably_not_linearly_independent, (void));
+ template<class T>
+ struct apply {
+ typedef list<
+ static_rational<0>,
+ typename add_zeroes_impl<N-1>::template apply<T>::type
+ > type;
+ };
+};
+
+template<>
+struct add_zeroes_impl<0> {
+ template<class T>
+ struct apply {
+ typedef T type;
+ };
+};
+
+// expand_dimensions finds the exponents of
+// a set of dimensions in a dimension_list.
+// the second parameter is assumed to be
+// a superset of the base_dimensions of
+// the first parameter.
+//
+// list<rational> expand_dimensions(dimension_list, list<base_dimension>);
+
+template<int N>
+struct expand_dimensions {
+ template<class Begin, class DimensionIterator>
+ struct apply {
+ typedef typename calculate_base_dimension_coefficients_func<
+ begins_with_dimension<DimensionIterator>::template apply<typename Begin::item>::value
+ >::template apply<DimensionIterator> result;
+ typedef list<
+ typename result::type,
+ typename expand_dimensions<N-1>::template apply<typename Begin::next, typename result::next>::type
+ > type;
+ };
+};
+
+template<>
+struct expand_dimensions<0> {
+ template<class Begin, class DimensionIterator>
+ struct apply {
+ typedef dimensionless_type type;
+ };
+};
+
+template<int N>
+struct create_unit_matrix {
+ template<class Begin, class Dimensions>
+ struct apply {
+ typedef typename create_unit_matrix<N - 1>::template apply<typename Begin::next, Dimensions>::type next;
+ typedef list<typename expand_dimensions<Dimensions::size::value>::template apply<Dimensions, typename Begin::item::dimension_type>::type, next> type;
+ };
+};
+
+template<>
+struct create_unit_matrix<0> {
+ template<class Begin, class Dimensions>
+ struct apply {
+ typedef dimensionless_type type;
+ };
+};
+
+template<class T>
+struct normalize_units {
+ typedef typename find_base_dimensions<T>::type dimensions;
+ typedef typename create_unit_matrix<(T::size::value)>::template apply<
+ T,
+ dimensions
+ >::type matrix;
+ typedef typename make_square_and_invert<matrix>::type type;
+ static const long extra = (type::size::value) - (T::size::value);
+};
+
+// multiply_add_units computes M x V
+// where M is a matrix and V is a horizontal
+// vector
+//
+// list<rational> multiply_add_units(list<list<rational> >, list<rational>);
+
+template<int N>
+struct multiply_add_units_impl {
+ template<class Begin1, class Begin2 ,class X>
+ struct apply {
+ typedef list<
+ typename mpl::plus<
+ typename mpl::times<
+ typename Begin2::item,
+ X
+ >::type,
+ typename Begin1::item
+ >::type,
+ typename multiply_add_units_impl<N-1>::template apply<
+ typename Begin1::next,
+ typename Begin2::next,
+ X
+ >::type
+ > type;
+ };
+};
+
+template<>
+struct multiply_add_units_impl<0> {
+ template<class Begin1, class Begin2 ,class X>
+ struct apply {
+ typedef dimensionless_type type;
+ };
+};
+
+template<int N>
+struct multiply_add_units {
+ template<class Begin1, class Begin2>
+ struct apply {
+ typedef typename multiply_add_units_impl<
+ (Begin2::item::size::value)
+ >::template apply<
+ typename multiply_add_units<N-1>::template apply<
+ typename Begin1::next,
+ typename Begin2::next
+ >::type,
+ typename Begin2::item,
+ typename Begin1::item
+ >::type type;
+ };
+};
+
+template<>
+struct multiply_add_units<1> {
+ template<class Begin1, class Begin2>
+ struct apply {
+ typedef typename add_zeroes_impl<
+ (Begin2::item::size::value)
+ >::template apply<dimensionless_type>::type type1;
+ typedef typename multiply_add_units_impl<
+ (Begin2::item::size::value)
+ >::template apply<
+ type1,
+ typename Begin2::item,
+ typename Begin1::item
+ >::type type;
+ };
+};
+
+
+// strip_zeroes erases the first N elements of a list if
+// they are all zero, otherwise returns inconsistent
+//
+// list strip_zeroes(list l, int N) {
+// if(N == 0) {
+// return(l);
+// } else if(l.front == 0) {
+// return(strip_zeroes(pop_front(l), N-1));
+// } else {
+// return(inconsistent);
+// }
+// }
+
+template<int N>
+struct strip_zeroes_impl;
+
+template<class T>
+struct strip_zeroes_func {
+ template<class L, int N>
+ struct apply {
+ typedef inconsistent type;
+ };
+};
+
+template<>
+struct strip_zeroes_func<static_rational<0> > {
+ template<class L, int N>
+ struct apply {
+ typedef typename strip_zeroes_impl<N-1>::template apply<typename L::next>::type type;
+ };
+};
+
+template<int N>
+struct strip_zeroes_impl {
+ template<class T>
+ struct apply {
+ typedef typename strip_zeroes_func<typename T::item>::template apply<T, N>::type type;
+ };
+};
+
+template<>
+struct strip_zeroes_impl<0> {
+ template<class T>
+ struct apply {
+ typedef T type;
+ };
+};
+
+// Given a list of base_units, computes the
+// exponents of each base unit for a given
+// dimension.
+//
+// list<rational> calculate_base_unit_exponents(list<base_unit> units, dimension_list dimensions);
+
+template<class T>
+struct is_base_dimension_unit {
+ typedef mpl::false_ type;
+ typedef void base_dimension_type;
+};
+template<class T>
+struct is_base_dimension_unit<list<dim<T, static_rational<1> >, dimensionless_type> > {
+ typedef mpl::true_ type;
+ typedef T base_dimension_type;
+};
+
+template<int N>
+struct is_simple_system_impl {
+ template<class Begin, class Prev>
+ struct apply {
+ typedef is_base_dimension_unit<typename Begin::item::dimension_type> test;
+ typedef mpl::and_<
+ typename test::type,
+ mpl::less<Prev, typename test::base_dimension_type>,
+ typename is_simple_system_impl<N-1>::template apply<
+ typename Begin::next,
+ typename test::base_dimension_type
+ >
+ > type;
+ static const bool value = (type::value);
+ };
+};
+
+template<>
+struct is_simple_system_impl<0> {
+ template<class Begin, class Prev>
+ struct apply : mpl::true_ {
+ };
+};
+
+template<class T>
+struct is_simple_system {
+ typedef T Begin;
+ typedef is_base_dimension_unit<typename Begin::item::dimension_type> test;
+ typedef typename mpl::and_<
+ typename test::type,
+ typename is_simple_system_impl<
+ T::size::value - 1
+ >::template apply<
+ typename Begin::next::type,
+ typename test::base_dimension_type
+ >
+ >::type type;
+ static const bool value = type::value;
+};
+
+template<bool>
+struct calculate_base_unit_exponents_impl;
+
+template<>
+struct calculate_base_unit_exponents_impl<true> {
+ template<class T, class Dimensions>
+ struct apply {
+ typedef typename expand_dimensions<(T::size::value)>::template apply<
+ typename find_base_dimensions<T>::type,
+ Dimensions
+ >::type type;
+ };
+};
+
+template<>
+struct calculate_base_unit_exponents_impl<false> {
+ template<class T, class Dimensions>
+ struct apply {
+ // find the units that correspond to each base dimension
+ typedef normalize_units<T> base_solutions;
+ // pad the dimension with zeroes so it can just be a
+ // list of numbers, making the multiplication easy
+ // e.g. if the arguments are list<pound, foot> and
+ // list<mass,time^-2> then this step will
+ // yield list<0,1,-2>
+ typedef typename expand_dimensions<(base_solutions::dimensions::size::value)>::template apply<
+ typename base_solutions::dimensions,
+ Dimensions
+ >::type dimensions;
+ // take the unit corresponding to each base unit
+ // multiply each of its exponents by the exponent
+ // of the base_dimension in the result and sum.
+ typedef typename multiply_add_units<dimensions::size::value>::template apply<
+ dimensions,
+ typename base_solutions::type
+ >::type units;
+ // Now, verify that the dummy units really
+ // cancel out and remove them.
+ typedef typename strip_zeroes_impl<base_solutions::extra>::template apply<units>::type type;
+ };
+};
+
+template<class T, class Dimensions>
+struct calculate_base_unit_exponents {
+ typedef typename calculate_base_unit_exponents_impl<is_simple_system<T>::value>::template apply<T, Dimensions>::type type;
+};
+
+} // namespace detail
+
+} // namespace units
+
+} // namespace boost
+
+#endif
diff --git a/boost/units/detail/one.hpp b/boost/units/detail/one.hpp
new file mode 100644
index 0000000..4cadc2c
--- /dev/null
+++ b/boost/units/detail/one.hpp
@@ -0,0 +1,109 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_DETAIL_ONE_HPP
+#define BOOST_UNITS_DETAIL_ONE_HPP
+
+#include <boost/units/operators.hpp>
+
+namespace boost {
+
+namespace units {
+
+struct one { one() {} };
+
+// workaround for pathscale.
+inline one make_one() {
+ one result;
+ return(result);
+}
+
+template<class T>
+struct multiply_typeof_helper<one, T>
+{
+ typedef T type;
+};
+
+template<class T>
+struct multiply_typeof_helper<T, one>
+{
+ typedef T type;
+};
+
+template<>
+struct multiply_typeof_helper<one, one>
+{
+ typedef one type;
+};
+
+template<class T>
+inline T operator*(const one&, const T& t)
+{
+ return(t);
+}
+
+template<class T>
+inline T operator*(const T& t, const one&)
+{
+ return(t);
+}
+
+inline one operator*(const one&, const one&)
+{
+ one result;
+ return(result);
+}
+
+template<class T>
+struct divide_typeof_helper<T, one>
+{
+ typedef T type;
+};
+
+template<class T>
+struct divide_typeof_helper<one, T>
+{
+ typedef T type;
+};
+
+template<>
+struct divide_typeof_helper<one, one>
+{
+ typedef one type;
+};
+
+template<class T>
+inline T operator/(const T& t, const one&)
+{
+ return(t);
+}
+
+template<class T>
+inline T operator/(const one&, const T& t)
+{
+ return(1/t);
+}
+
+inline one operator/(const one&, const one&)
+{
+ one result;
+ return(result);
+}
+
+template<class T>
+inline bool operator>(const boost::units::one&, const T& t) {
+ return(1 > t);
+}
+
+} // namespace units
+
+} // namespace boost
+
+#endif
diff --git a/boost/units/detail/ordinal.hpp b/boost/units/detail/ordinal.hpp
new file mode 100644
index 0000000..b47ef67
--- /dev/null
+++ b/boost/units/detail/ordinal.hpp
@@ -0,0 +1,49 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_DETAIL_ORDINAL_HPP_INCLUDED
+#define BOOST_UNITS_DETAIL_ORDINAL_HPP_INCLUDED
+
+#include <boost/mpl/less.hpp>
+#include <boost/mpl/bool.hpp>
+
+namespace boost {
+namespace units {
+
+namespace detail {
+
+struct ordinal_tag {};
+
+}
+
+template<int N>
+struct ordinal {
+ typedef detail::ordinal_tag tag;
+ static const long value = N;
+};
+
+template<int N>
+const long ordinal<N>::value;
+
+}
+
+namespace mpl {
+
+template<>
+struct less_impl<units::detail::ordinal_tag, units::detail::ordinal_tag> {
+ template<class T1, class T2>
+ struct apply : bool_<(T1::value) < (T2::value)> {};
+};
+
+}
+
+}
+
+#endif
diff --git a/boost/units/detail/prevent_redefinition.hpp b/boost/units/detail/prevent_redefinition.hpp
new file mode 100644
index 0000000..fba969a
--- /dev/null
+++ b/boost/units/detail/prevent_redefinition.hpp
@@ -0,0 +1,54 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_DETAIL_PREVENT_REDEFINITION_HPP
+#define BOOST_UNITS_DETAIL_PREVENT_REDEFINITION_HPP
+
+#include <boost/mpl/long.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace detail {
+
+struct no { no() {} char dummy; };
+struct yes { no dummy[2]; };
+
+template<bool> struct ordinal_has_already_been_defined;
+
+template<>
+struct ordinal_has_already_been_defined<true> { };
+
+template<>
+struct ordinal_has_already_been_defined<false> { typedef void type; };
+
+}
+
+/// This must be in namespace boost::units so that ADL
+/// will work. we need a mangled name because it must
+/// be found by ADL
+/// INTERNAL ONLY
+template<class T>
+detail::no
+boost_units_is_registered(const T&)
+{ detail::no result; return(result); }
+
+/// INTERNAL ONLY
+template<class T>
+detail::no
+boost_units_unit_is_registered(const T&)
+{ detail::no result; return(result); }
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_PREVENT_ORDINAL_REDEFINITION_IMPL_HPP
diff --git a/boost/units/detail/push_front_if.hpp b/boost/units/detail/push_front_if.hpp
new file mode 100644
index 0000000..b924a24
--- /dev/null
+++ b/boost/units/detail/push_front_if.hpp
@@ -0,0 +1,48 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_DETAIL_PUSH_FRONT_IF_HPP
+#define BOOST_UNITS_DETAIL_PUSH_FRONT_IF_HPP
+
+namespace boost {
+
+namespace units {
+
+template<class T, class Next>
+struct list;
+
+namespace detail {
+
+template<bool>
+struct push_front_if;
+
+template<>
+struct push_front_if<true> {
+ template<class L, class T>
+ struct apply {
+ typedef list<T, L> type;
+ };
+};
+
+template<>
+struct push_front_if<false> {
+ template<class L, class T>
+ struct apply {
+ typedef L type;
+ };
+};
+
+}
+
+}
+
+}
+
+#endif
diff --git a/boost/units/detail/push_front_or_add.hpp b/boost/units/detail/push_front_or_add.hpp
new file mode 100644
index 0000000..a3092da
--- /dev/null
+++ b/boost/units/detail/push_front_or_add.hpp
@@ -0,0 +1,84 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_DETAIL_PUSH_FRONT_OR_ADD_HPP
+#define BOOST_UNITS_DETAIL_PUSH_FRONT_OR_ADD_HPP
+
+#include <boost/mpl/plus.hpp>
+#include <boost/mpl/front.hpp>
+#include <boost/mpl/push_front.hpp>
+#include <boost/mpl/pop_front.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+#include <boost/units/units_fwd.hpp>
+#include <boost/units/detail/push_front_if.hpp>
+
+namespace boost {
+
+namespace units {
+
+template<class Item, class Next>
+struct list;
+
+namespace detail {
+
+template<class T>
+struct is_empty_dim;
+
+/// add an instantiation of dim to Sequence.
+template<bool>
+struct push_front_or_add_impl;
+
+template<>
+struct push_front_or_add_impl<true>
+{
+ template<typename Sequence, typename T>
+ struct apply
+ {
+ typedef typename mpl::plus<T, typename Sequence::item>::type item;
+ typedef typename push_front_if<!is_empty_dim<item>::value>::template apply<
+ typename Sequence::next,
+ item
+ > type;
+ };
+};
+
+template<>
+struct push_front_or_add_impl<false>
+{
+ template<typename Sequence, typename T>
+ struct apply
+ {
+ typedef list<T, Sequence> type;
+ };
+};
+
+template<typename Sequence, typename T>
+struct push_front_or_add
+{
+ typedef typename push_front_or_add_impl<boost::is_same<typename T::tag_type, typename Sequence::item::tag_type>::value>::template apply<
+ Sequence,
+ T
+ >::type type;
+};
+
+template<typename T>
+struct push_front_or_add<dimensionless_type, T>
+{
+ typedef list<T, dimensionless_type> type;
+};
+
+} // namespace detail
+
+} // namespace units
+
+} // namespace boost
+
+#endif
diff --git a/boost/units/detail/sort.hpp b/boost/units/detail/sort.hpp
new file mode 100644
index 0000000..389adfe
--- /dev/null
+++ b/boost/units/detail/sort.hpp
@@ -0,0 +1,109 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_DETAIL_SORT_HPP
+#define BOOST_UNITS_DETAIL_SORT_HPP
+
+#include <boost/mpl/size.hpp>
+#include <boost/mpl/begin.hpp>
+#include <boost/mpl/next.hpp>
+#include <boost/mpl/deref.hpp>
+#include <boost/mpl/push_front.hpp>
+#include <boost/mpl/less.hpp>
+
+#include <boost/units/dimensionless_type.hpp>
+#include <boost/units/detail/dimension_list.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace detail {
+
+template<int N>
+struct insertion_sort_insert;
+
+template<bool is_greater>
+struct insertion_sort_comparison_impl;
+
+// have to recursively add the element to the next sequence.
+template<>
+struct insertion_sort_comparison_impl<true> {
+ template<class Begin, int N, class T>
+ struct apply {
+ typedef list<
+ typename Begin::item,
+ typename insertion_sort_insert<N - 1>::template apply<
+ typename Begin::next,
+ T
+ >::type
+ > type;
+ };
+};
+
+// prepend the current element
+template<>
+struct insertion_sort_comparison_impl<false> {
+ template<class Begin, int N, class T>
+ struct apply {
+ typedef list<T, Begin> type;
+ };
+};
+
+template<int N>
+struct insertion_sort_insert {
+ template<class Begin, class T>
+ struct apply {
+ typedef typename insertion_sort_comparison_impl<mpl::less<typename Begin::item, T>::value>::template apply<
+ Begin,
+ N,
+ T
+ >::type type;
+ };
+};
+
+template<>
+struct insertion_sort_insert<0> {
+ template<class Begin, class T>
+ struct apply {
+ typedef list<T, dimensionless_type> type;
+ };
+};
+
+template<int N>
+struct insertion_sort_impl {
+ template<class Begin>
+ struct apply {
+ typedef typename insertion_sort_impl<N - 1>::template apply<typename Begin::next>::type next;
+ typedef typename insertion_sort_insert<(next::size::value)>::template apply<next, typename Begin::item>::type type;
+ };
+};
+
+template<>
+struct insertion_sort_impl<0> {
+ template<class Begin>
+ struct apply {
+ typedef dimensionless_type type;
+ };
+};
+
+template<class T>
+struct insertion_sort
+{
+ typedef typename insertion_sort_impl<T::size::value>::template apply<T>::type type;
+};
+
+} // namespace detail
+
+} // namespace units
+
+} // namespace boost
+
+#endif
diff --git a/boost/units/detail/static_rational_power.hpp b/boost/units/detail/static_rational_power.hpp
new file mode 100644
index 0000000..9c71f55
--- /dev/null
+++ b/boost/units/detail/static_rational_power.hpp
@@ -0,0 +1,206 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_DETAIL_STATIC_RATIONAL_POWER_HPP
+#define BOOST_UNITS_DETAIL_STATIC_RATIONAL_POWER_HPP
+
+#include <boost/config/no_tr1/cmath.hpp>
+
+#include <boost/units/detail/one.hpp>
+#include <boost/units/operators.hpp>
+
+namespace boost {
+
+namespace units {
+
+template<long N,long D>
+class static_rational;
+
+namespace detail {
+
+namespace typeof_pow_adl_barrier {
+
+using std::pow;
+
+template<class Y>
+struct typeof_pow
+{
+#if defined(BOOST_UNITS_HAS_BOOST_TYPEOF)
+ BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested, pow(typeof_::make<Y>(), 0.0))
+ typedef typename nested::type type;
+#elif defined(BOOST_UNITS_HAS_MWERKS_TYPEOF)
+ typedef __typeof__(pow(typeof_::make<Y>(), 0.0)) type;
+#elif defined(BOOST_UNITS_HAS_GNU_TYPEOF)
+ typedef typeof(pow(typeof_::make<Y>(), 0.0)) type;
+#else
+ typedef Y type;
+#endif
+};
+
+}
+
+template<class R, class Y>
+struct static_rational_power_impl
+{
+ typedef typename typeof_pow_adl_barrier::typeof_pow<Y>::type type;
+ static type call(const Y& y)
+ {
+ using std::pow;
+ return(pow(y, static_cast<double>(R::Numerator) / static_cast<double>(R::Denominator)));
+ }
+};
+
+template<class R>
+struct static_rational_power_impl<R, one>
+{
+ typedef one type;
+ static one call(const one&)
+ {
+ one result;
+ return(result);
+ }
+};
+
+template<long N>
+struct static_rational_power_impl<static_rational<N, 1>, one>
+{
+ typedef one type;
+ static one call(const one&)
+ {
+ one result;
+ return(result);
+ }
+};
+
+template<long N, bool = (N % 2 == 0)>
+struct static_int_power_impl;
+
+template<long N>
+struct static_int_power_impl<N, true>
+{
+ template<class Y, class R>
+ struct apply
+ {
+ typedef typename multiply_typeof_helper<Y, Y>::type square_type;
+ typedef typename static_int_power_impl<(N >> 1)>::template apply<square_type, R> next;
+ typedef typename next::type type;
+ static type call(const Y& y, const R& r)
+ {
+ const Y square = y * y;
+ return(next::call(square, r));
+ }
+ };
+};
+
+template<long N>
+struct static_int_power_impl<N, false>
+{
+ template<class Y, class R>
+ struct apply
+ {
+ typedef typename multiply_typeof_helper<Y, Y>::type square_type;
+ typedef typename multiply_typeof_helper<Y, R>::type new_r;
+ typedef typename static_int_power_impl<(N >> 1)>::template apply<square_type, new_r> next;
+ typedef typename next::type type;
+ static type call(const Y& y, const R& r)
+ {
+ const Y square = y * y;
+ return(next::call(square, y * r));
+ }
+ };
+};
+
+template<>
+struct static_int_power_impl<1, false>
+{
+ template<class Y, class R>
+ struct apply
+ {
+ typedef typename multiply_typeof_helper<Y, R>::type type;
+ static type call(const Y& y, const R& r)
+ {
+ return(y * r);
+ }
+ };
+};
+
+template<>
+struct static_int_power_impl<0, true>
+{
+ template<class Y, class R>
+ struct apply
+ {
+ typedef R type;
+ static R call(const Y&, const R& r)
+ {
+ return(r);
+ }
+ };
+};
+
+template<int N, bool = (N < 0)>
+struct static_int_power_sign_impl;
+
+template<int N>
+struct static_int_power_sign_impl<N, false>
+{
+ template<class Y>
+ struct apply
+ {
+ typedef typename static_int_power_impl<N>::template apply<Y, one> impl;
+ typedef typename impl::type type;
+ static type call(const Y& y)
+ {
+ one result;
+ return(impl::call(y, result));
+ }
+ };
+};
+
+template<int N>
+struct static_int_power_sign_impl<N, true>
+{
+ template<class Y>
+ struct apply
+ {
+ typedef typename static_int_power_impl<-N>::template apply<Y, one> impl;
+ typedef typename divide_typeof_helper<one, typename impl::type>::type type;
+ static type call(const Y& y)
+ {
+ one result;
+ return(result/impl::call(y, result));
+ }
+ };
+};
+
+template<long N, class Y>
+struct static_rational_power_impl<static_rational<N, 1>, Y>
+{
+ typedef typename static_int_power_sign_impl<N>::template apply<Y> impl;
+ typedef typename impl::type type;
+ static Y call(const Y& y)
+ {
+ return(impl::call(y));
+ }
+};
+
+template<class R, class Y>
+typename detail::static_rational_power_impl<R, Y>::type static_rational_power(const Y& y)
+{
+ return(detail::static_rational_power_impl<R, Y>::call(y));
+}
+
+} // namespace detail
+
+} // namespace units
+
+} // namespace boost
+
+#endif
diff --git a/boost/units/detail/unscale.hpp b/boost/units/detail/unscale.hpp
new file mode 100644
index 0000000..08e51e9
--- /dev/null
+++ b/boost/units/detail/unscale.hpp
@@ -0,0 +1,234 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_DETAIL_UNSCALE_HPP_INCLUDED
+#define BOOST_UNITS_DETAIL_UNSCALE_HPP_INCLUDED
+
+#include <string>
+
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/size.hpp>
+#include <boost/mpl/begin.hpp>
+#include <boost/mpl/next.hpp>
+#include <boost/mpl/deref.hpp>
+#include <boost/mpl/plus.hpp>
+#include <boost/mpl/times.hpp>
+#include <boost/mpl/negate.hpp>
+#include <boost/mpl/less.hpp>
+
+#include <boost/units/config.hpp>
+#include <boost/units/dimension.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/units_fwd.hpp>
+#include <boost/units/detail/one.hpp>
+
+namespace boost {
+
+namespace units {
+
+template<class T>
+struct heterogeneous_system;
+
+template<class T, class D, class Scale>
+struct heterogeneous_system_impl;
+
+template<class T, class E>
+struct heterogeneous_system_dim;
+
+template<class S, class Scale>
+struct scaled_base_unit;
+
+/// removes all scaling from a unit or a base unit.
+template<class T>
+struct unscale
+{
+#ifndef BOOST_UNITS_DOXYGEN
+ typedef T type;
+#else
+ typedef detail::unspecified type;
+#endif
+};
+
+/// INTERNAL ONLY
+template<class S, class Scale>
+struct unscale<scaled_base_unit<S, Scale> >
+{
+ typedef typename unscale<S>::type type;
+};
+
+/// INTERNAL ONLY
+template<class D, class S>
+struct unscale<unit<D, S> >
+{
+ typedef unit<D, typename unscale<S>::type> type;
+};
+
+/// INTERNAL ONLY
+template<class Scale>
+struct scale_list_dim;
+
+/// INTERNAL ONLY
+template<class T>
+struct get_scale_list
+{
+ typedef dimensionless_type type;
+};
+
+/// INTERNAL ONLY
+template<class S, class Scale>
+struct get_scale_list<scaled_base_unit<S, Scale> >
+{
+ typedef typename mpl::times<list<scale_list_dim<Scale>, dimensionless_type>, typename get_scale_list<S>::type>::type type;
+};
+
+/// INTERNAL ONLY
+template<class D, class S>
+struct get_scale_list<unit<D, S> >
+{
+ typedef typename get_scale_list<S>::type type;
+};
+
+/// INTERNAL ONLY
+struct scale_dim_tag {};
+
+/// INTERNAL ONLY
+template<class Scale>
+struct scale_list_dim : Scale
+{
+ typedef scale_dim_tag tag;
+ typedef scale_list_dim type;
+};
+
+} // namespace units
+
+#ifndef BOOST_UNITS_DOXYGEN
+
+namespace mpl {
+
+/// INTERNAL ONLY
+template<>
+struct less_impl<boost::units::scale_dim_tag, boost::units::scale_dim_tag>
+{
+ template<class T0, class T1>
+ struct apply : mpl::bool_<((T0::base) < (T1::base))> {};
+};
+
+}
+
+#endif
+
+namespace units {
+
+namespace detail {
+
+template<class Scale>
+struct is_empty_dim<scale_list_dim<Scale> > : mpl::false_ {};
+
+template<long N>
+struct is_empty_dim<scale_list_dim<scale<N, static_rational<0, 1> > > > : mpl::true_ {};
+
+template<int N>
+struct eval_scale_list_impl
+{
+ template<class Begin>
+ struct apply
+ {
+ typedef typename eval_scale_list_impl<N-1>::template apply<typename Begin::next> next_iteration;
+ typedef typename multiply_typeof_helper<typename next_iteration::type, typename Begin::item::value_type>::type type;
+ static type value()
+ {
+ return(next_iteration::value() * Begin::item::value());
+ }
+ };
+};
+
+template<>
+struct eval_scale_list_impl<0>
+{
+ template<class Begin>
+ struct apply
+ {
+ typedef one type;
+ static one value()
+ {
+ one result;
+ return(result);
+ }
+ };
+};
+
+}
+
+/// INTERNAL ONLY
+template<class T>
+struct eval_scale_list : detail::eval_scale_list_impl<T::size::value>::template apply<T> {};
+
+} // namespace units
+
+#ifndef BOOST_UNITS_DOXYGEN
+
+namespace mpl {
+
+/// INTERNAL ONLY
+template<>
+struct plus_impl<boost::units::scale_dim_tag, boost::units::scale_dim_tag>
+{
+ template<class T0, class T1>
+ struct apply
+ {
+ typedef boost::units::scale_list_dim<
+ boost::units::scale<
+ (T0::base),
+ typename mpl::plus<typename T0::exponent, typename T1::exponent>::type
+ >
+ > type;
+ };
+};
+
+/// INTERNAL ONLY
+template<>
+struct negate_impl<boost::units::scale_dim_tag>
+{
+ template<class T0>
+ struct apply
+ {
+ typedef boost::units::scale_list_dim<
+ boost::units::scale<
+ (T0::base),
+ typename mpl::negate<typename T0::exponent>::type
+ >
+ > type;
+ };
+};
+
+/// INTERNAL ONLY
+template<>
+struct times_impl<boost::units::scale_dim_tag, boost::units::detail::static_rational_tag>
+{
+ template<class T0, class T1>
+ struct apply
+ {
+ typedef boost::units::scale_list_dim<
+ boost::units::scale<
+ (T0::base),
+ typename mpl::times<typename T0::exponent, T1>::type
+ >
+ > type;
+ };
+};
+
+} // namespace mpl
+
+#endif
+
+} // namespace boost
+
+#endif
diff --git a/boost/units/detail/utility.hpp b/boost/units/detail/utility.hpp
new file mode 100644
index 0000000..da46b45
--- /dev/null
+++ b/boost/units/detail/utility.hpp
@@ -0,0 +1,104 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_UTILITY_HPP
+#define BOOST_UNITS_UTILITY_HPP
+
+#include <cstdlib>
+#include <typeinfo>
+#include <string>
+
+#if defined(__GLIBCXX__) || defined(__GLIBCPP__)
+#define BOOST_UNITS_USE_DEMANGLING
+#include <cxxabi.h>
+#endif // __GNUC__
+
+#ifdef BOOST_UNITS_USE_DEMANGLING
+
+#include <boost/algorithm/string/replace.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace detail {
+
+inline
+std::string
+demangle(const char* name)
+{
+ // need to demangle C++ symbols
+ char* realname;
+ std::size_t len;
+ int stat;
+
+ realname = abi::__cxa_demangle(name,NULL,&len,&stat);
+
+ if (realname != NULL)
+ {
+ std::string out(realname);
+
+ std::free(realname);
+
+ boost::replace_all(out,"boost::units::","");
+
+ return out;
+ }
+
+ return std::string("demangle :: error - unable to demangle specified symbol");
+}
+
+} // namespace detail
+
+template<class L>
+std::string simplify_typename(const L& /*source*/)
+{
+ const std::string demangled = detail::demangle(typeid(L).name());
+
+ return demangled;
+}
+
+} // namespace units
+
+} // namespace boost
+
+#else // BOOST_UNITS_USE_DEMANGLING
+
+namespace boost {
+
+namespace units {
+
+namespace detail {
+
+inline
+std::string
+demangle(const char* name)
+{
+ return name;
+}
+
+} // namespace detail
+
+template<class L>
+std::string simplify_typename(const L& /*source*/)
+{
+ return std::string(typeid(L).name());
+}
+
+} // namespace units
+
+} // namespace boost
+
+// To get system-specific predefined macros:
+// gcc -arch ppc -dM -E - < /dev/null | sort
+
+#endif // BOOST_UNITS_USE_DEMANGLING
+
+#endif // BOOST_UNITS_UTILITY_HPP
diff --git a/boost/units/dim.hpp b/boost/units/dim.hpp
new file mode 100644
index 0000000..eb28131
--- /dev/null
+++ b/boost/units/dim.hpp
@@ -0,0 +1,167 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_DIM_HPP
+#define BOOST_UNITS_DIM_HPP
+
+#include <boost/static_assert.hpp>
+
+#include <boost/type_traits/is_same.hpp>
+
+#include <boost/mpl/arithmetic.hpp>
+
+#include <boost/units/config.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/detail/dim_impl.hpp>
+
+/// \file dim.hpp
+/// \brief Handling of fundamental dimension/exponent pairs.
+
+namespace boost {
+
+namespace units {
+
+namespace detail {
+
+struct dim_tag { };
+
+}
+
+/// \brief Dimension tag/exponent pair for a single fundamental dimension.
+///
+/// \details
+/// The dim class represents a single dimension tag/dimension exponent pair.
+/// That is, @c dim<tag_type,value_type> is a pair where @c tag_type represents the
+/// fundamental dimension being represented and @c value_type represents the
+/// exponent of that fundamental dimension as a @c static_rational. @c tag_type must
+/// be a derived from a specialization of @c base_dimension.
+/// Specialization of the following Boost.MPL metafunctions are provided
+///
+/// - @c mpl::plus for two @c dims
+/// - @c mpl::minus for two @c dims
+/// - @c mpl::negate for a @c dim
+///
+/// These metafunctions all operate on the exponent, and require
+/// that the @c dim operands have the same base dimension tag.
+/// In addition, multiplication and division by @c static_rational
+/// is supported.
+///
+/// - @c mpl::times for a @c static_rational and a @c dim in either order
+/// - @c mpl::divides for a @c static_rational and a @c dim in either order
+///
+/// These metafunctions likewise operate on the exponent only.
+template<typename T,typename V>
+struct dim
+{
+ typedef dim type;
+ typedef detail::dim_tag tag;
+ typedef T tag_type;
+ typedef V value_type;
+};
+
+} // namespace units
+
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::dim, 2)
+
+#endif
+
+#ifndef BOOST_UNITS_DOXYGEN
+
+namespace boost {
+
+namespace mpl {
+
+// define MPL operators acting on dim<T,V>
+
+template<>
+struct plus_impl<boost::units::detail::dim_tag,boost::units::detail::dim_tag>
+{
+ template<class T0, class T1>
+ struct apply
+ {
+ BOOST_STATIC_ASSERT((boost::is_same<typename T0::tag_type,typename T1::tag_type>::value == true));
+ typedef boost::units::dim<typename T0::tag_type, typename mpl::plus<typename T0::value_type, typename T1::value_type>::type> type;
+ };
+};
+
+template<>
+struct minus_impl<boost::units::detail::dim_tag,boost::units::detail::dim_tag>
+{
+ template<class T0, class T1>
+ struct apply
+ {
+ BOOST_STATIC_ASSERT((boost::is_same<typename T0::tag_type,typename T1::tag_type>::value == true));
+ typedef boost::units::dim<typename T0::tag_type, typename mpl::minus<typename T0::value_type, typename T1::value_type>::type> type;
+ };
+};
+
+template<>
+struct times_impl<boost::units::detail::dim_tag,boost::units::detail::static_rational_tag>
+{
+ template<class T0, class T1>
+ struct apply
+ {
+ typedef boost::units::dim<typename T0::tag_type, typename mpl::times<typename T0::value_type, T1>::type> type;
+ };
+};
+
+template<>
+struct times_impl<boost::units::detail::static_rational_tag,boost::units::detail::dim_tag>
+{
+ template<class T0, class T1>
+ struct apply
+ {
+ typedef boost::units::dim<typename T1::tag_type, typename mpl::times<T0, typename T1::value_type>::type> type;
+ };
+};
+
+template<>
+struct divides_impl<boost::units::detail::dim_tag,boost::units::detail::static_rational_tag>
+{
+ template<class T0, class T1>
+ struct apply
+ {
+ typedef boost::units::dim<typename T0::tag_type, typename mpl::divides<typename T0::value_type, T1>::type> type;
+ };
+};
+
+template<>
+struct divides_impl<boost::units::detail::static_rational_tag,boost::units::detail::dim_tag>
+{
+ template<class T0, class T1>
+ struct apply
+ {
+ typedef boost::units::dim<typename T1::tag_type, typename mpl::divides<T0, typename T1::value_type>::type> type;
+ };
+};
+
+template<>
+struct negate_impl<boost::units::detail::dim_tag>
+{
+ template<class T0>
+ struct apply
+ {
+ typedef boost::units::dim<typename T0::tag_type,typename mpl::negate<typename T0::value_type>::type> type;
+ };
+};
+
+} // namespace mpl
+
+} // namespace boost
+
+#endif
+
+#endif // BOOST_UNITS_DIM_HPP
diff --git a/boost/units/dimension.hpp b/boost/units/dimension.hpp
new file mode 100644
index 0000000..90334a1
--- /dev/null
+++ b/boost/units/dimension.hpp
@@ -0,0 +1,150 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_DIMENSION_HPP
+#define BOOST_UNITS_DIMENSION_HPP
+
+#include <boost/static_assert.hpp>
+
+#include <boost/type_traits/is_same.hpp>
+
+#include <boost/mpl/arithmetic.hpp>
+
+#include <boost/units/static_rational.hpp>
+#include <boost/units/detail/dimension_list.hpp>
+#include <boost/units/detail/dimension_impl.hpp>
+
+/// \file
+/// \brief Core metaprogramming utilities for compile-time dimensional analysis.
+
+namespace boost {
+
+namespace units {
+
+/// Reduce dimension list to cardinal form. This algorithm collapses duplicate
+/// base dimension tags and sorts the resulting list by the tag ordinal value.
+/// Dimension lists that resolve to the same dimension are guaranteed to be
+/// represented by an identical type.
+///
+/// The argument should be an MPL forward sequence containing instances
+/// of the @c dim template.
+///
+/// The result is also an MPL forward sequence. It also supports the
+/// following metafunctions to allow use as a dimension.
+///
+/// - @c mpl::plus is defined only on two equal dimensions and returns the argument unchanged.
+/// - @c mpl::minus is defined only for two equal dimensions and returns the argument unchanged.
+/// - @c mpl::negate will return its argument unchanged.
+/// - @c mpl::times is defined for any dimensions and adds corresponding exponents.
+/// - @c mpl::divides is defined for any dimensions and subtracts the exponents of the
+/// right had argument from the corresponding exponents of the left had argument.
+/// Missing base dimension tags are assumed to have an exponent of zero.
+/// - @c static_power takes a dimension and a static_rational and multiplies all
+/// the exponents of the dimension by the static_rational.
+/// - @c static_root takes a dimension and a static_rational and divides all
+/// the exponents of the dimension by the static_rational.
+template<typename Seq>
+struct make_dimension_list
+{
+ typedef typename detail::sort_dims<Seq>::type type;
+};
+
+/// Raise a dimension list to a scalar power.
+template<typename DL,typename Ex>
+struct static_power
+{
+ typedef typename detail::static_power_impl<DL::size::value>::template apply<
+ DL,
+ Ex
+ >::type type;
+};
+
+/// Take a scalar root of a dimension list.
+template<typename DL,typename Rt>
+struct static_root
+{
+ typedef typename detail::static_root_impl<DL::size::value>::template apply<
+ DL,
+ Rt
+ >::type type;
+};
+
+} // namespace units
+
+#ifndef BOOST_UNITS_DOXYGEN
+
+namespace mpl {
+
+template<>
+struct plus_impl<boost::units::detail::dimension_list_tag,boost::units::detail::dimension_list_tag>
+{
+ template<class T0, class T1>
+ struct apply
+ {
+ BOOST_STATIC_ASSERT((boost::is_same<T0,T1>::value == true));
+ typedef T0 type;
+ };
+};
+
+template<>
+struct minus_impl<boost::units::detail::dimension_list_tag,boost::units::detail::dimension_list_tag>
+{
+ template<class T0, class T1>
+ struct apply
+ {
+ BOOST_STATIC_ASSERT((boost::is_same<T0,T1>::value == true));
+ typedef T0 type;
+ };
+};
+
+template<>
+struct times_impl<boost::units::detail::dimension_list_tag,boost::units::detail::dimension_list_tag>
+{
+ template<class T0, class T1>
+ struct apply
+ {
+ typedef typename boost::units::detail::merge_dimensions<T0,T1>::type type;
+ };
+};
+
+template<>
+struct divides_impl<boost::units::detail::dimension_list_tag,boost::units::detail::dimension_list_tag>
+{
+ template<class T0, class T1>
+ struct apply
+ {
+ typedef typename boost::units::detail::merge_dimensions<
+ T0,
+ typename boost::units::detail::static_inverse_impl<
+ T1::size::value
+ >::template apply<
+ T1
+ >::type
+ >::type type;
+ };
+};
+
+template<>
+struct negate_impl<boost::units::detail::dimension_list_tag>
+{
+ template<class T0>
+ struct apply
+ {
+ typedef T0 type;
+ };
+};
+
+} // namespace mpl
+
+#endif
+
+} // namespace boost
+
+#endif // BOOST_UNITS_DIMENSION_HPP
diff --git a/boost/units/dimensionless_quantity.hpp b/boost/units/dimensionless_quantity.hpp
new file mode 100644
index 0000000..7ac6bfb
--- /dev/null
+++ b/boost/units/dimensionless_quantity.hpp
@@ -0,0 +1,37 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_DIMENSIONLESS_QUANTITY_HPP
+#define BOOST_UNITS_DIMENSIONLESS_QUANTITY_HPP
+
+///
+/// \file
+/// \brief Utility class to simplify construction of dimensionless quantities.
+///
+
+#include <boost/units/dimensionless_unit.hpp>
+#include <boost/units/quantity.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// Utility class to simplify construction of dimensionless quantities.
+template<class System,class Y>
+struct dimensionless_quantity
+{
+ typedef quantity<typename dimensionless_unit<System>::type,Y> type;
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_DIMENSIONLESS_QUANTITY_HPP
diff --git a/boost/units/dimensionless_type.hpp b/boost/units/dimensionless_type.hpp
new file mode 100644
index 0000000..c8dae9f
--- /dev/null
+++ b/boost/units/dimensionless_type.hpp
@@ -0,0 +1,55 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_DIMENSIONLESS_TYPE_HPP
+#define BOOST_UNITS_DIMENSIONLESS_TYPE_HPP
+
+///
+/// \file
+/// \brief Dimension lists in which all exponents resolve to zero reduce to @c dimensionless_type.
+///
+
+#include <boost/mpl/long.hpp>
+#include <boost/mpl/deref.hpp>
+#include <boost/mpl/arithmetic.hpp>
+
+#include <boost/units/config.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace detail {
+
+struct dimension_list_tag;
+
+}
+
+/// Dimension lists in which all exponents resolve to zero reduce to @c dimensionless_type.
+struct dimensionless_type
+{
+ typedef dimensionless_type type;
+ typedef detail::dimension_list_tag tag;
+ typedef mpl::long_<0> size;
+};
+
+} // namespace units
+
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::dimensionless_type)
+
+#endif
+
+#endif // BOOST_UNITS_DIMENSIONLESS_TYPE_HPP
diff --git a/boost/units/dimensionless_unit.hpp b/boost/units/dimensionless_unit.hpp
new file mode 100644
index 0000000..8e6368f
--- /dev/null
+++ b/boost/units/dimensionless_unit.hpp
@@ -0,0 +1,37 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_DIMENSIONLESS_UNIT_HPP
+#define BOOST_UNITS_DIMENSIONLESS_UNIT_HPP
+
+///
+/// \file
+/// \brief Utility class to simplify construction of dimensionless units in a system.
+///
+
+#include <boost/units/dimensionless_type.hpp>
+#include <boost/units/unit.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// Utility class to simplify construction of dimensionless units in a system.
+template<class System>
+struct dimensionless_unit
+{
+ typedef unit<dimensionless_type,System> type;
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_DIMENSIONLESS_UNIT_HPP
diff --git a/boost/units/get_dimension.hpp b/boost/units/get_dimension.hpp
new file mode 100644
index 0000000..c0a7ab9
--- /dev/null
+++ b/boost/units/get_dimension.hpp
@@ -0,0 +1,54 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_GET_DIMENSION_HPP
+#define BOOST_UNITS_GET_DIMENSION_HPP
+
+///
+/// \file
+/// \brief Get the dimension of a unit, absolute unit and quantity.
+/// \details
+///
+
+#include <boost/units/units_fwd.hpp>
+
+namespace boost {
+
+namespace units {
+
+template<class T>
+struct get_dimension {};
+
+/// Get the dimension of a unit.
+template<class Dim,class System>
+struct get_dimension< unit<Dim,System> >
+{
+ typedef Dim type;
+};
+
+/// Get the dimension of an absolute unit.
+template<class Unit>
+struct get_dimension< absolute<Unit> >
+{
+ typedef typename get_dimension<Unit>::type type;
+};
+
+/// Get the dimension of a quantity.
+template<class Unit,class Y>
+struct get_dimension< quantity<Unit,Y> >
+{
+ typedef typename get_dimension<Unit>::type type;
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_GET_DIMENSION_HPP
diff --git a/boost/units/get_system.hpp b/boost/units/get_system.hpp
new file mode 100644
index 0000000..ce4e59f
--- /dev/null
+++ b/boost/units/get_system.hpp
@@ -0,0 +1,51 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_GET_SYSTEM_HPP
+#define BOOST_UNITS_GET_SYSTEM_HPP
+
+/// \file
+/// \brief Get the system of a unit, absolute unit or quantity.
+
+#include <boost/units/units_fwd.hpp>
+
+namespace boost {
+
+namespace units {
+
+template<class T>
+struct get_system {};
+
+/// Get the system of a unit.
+template<class Dim,class System>
+struct get_system< unit<Dim,System> >
+{
+ typedef System type;
+};
+
+/// Get the system of an absolute unit.
+template<class Unit>
+struct get_system< absolute<Unit> >
+{
+ typedef typename get_system<Unit>::type type;
+};
+
+/// Get the system of a quantity.
+template<class Unit,class Y>
+struct get_system< quantity<Unit,Y> >
+{
+ typedef typename get_system<Unit>::type type;
+};
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_GET_SYSTEM_HPP
diff --git a/boost/units/heterogeneous_system.hpp b/boost/units/heterogeneous_system.hpp
new file mode 100644
index 0000000..966797a
--- /dev/null
+++ b/boost/units/heterogeneous_system.hpp
@@ -0,0 +1,428 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_HETEROGENEOUS_SYSTEM_HPP
+#define BOOST_UNITS_HETEROGENEOUS_SYSTEM_HPP
+
+/// \file
+/// \brief A heterogeneous system is a sorted list of base unit/exponent pairs.
+
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/plus.hpp>
+#include <boost/mpl/times.hpp>
+#include <boost/mpl/divides.hpp>
+#include <boost/mpl/negate.hpp>
+#include <boost/mpl/less.hpp>
+#include <boost/mpl/size.hpp>
+#include <boost/mpl/begin.hpp>
+#include <boost/mpl/next.hpp>
+#include <boost/mpl/deref.hpp>
+#include <boost/mpl/front.hpp>
+#include <boost/mpl/push_front.hpp>
+#include <boost/mpl/pop_front.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+#include <boost/units/config.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/dimension.hpp>
+#include <boost/units/units_fwd.hpp>
+#include <boost/units/detail/push_front_if.hpp>
+#include <boost/units/detail/push_front_or_add.hpp>
+#include <boost/units/detail/linear_algebra.hpp>
+#include <boost/units/detail/unscale.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace detail {
+
+// A normal system is a sorted list of base units.
+// A heterogeneous system is a sorted list of base unit/exponent pairs.
+// As long as we don't need to convert heterogeneous systems
+// directly everything is cool.
+
+template<class T>
+struct is_zero : mpl::false_ {};
+
+template<>
+struct is_zero<static_rational<0> > : mpl::true_ {};
+
+} // namespace detail
+
+/// INTERNAL ONLY
+template<class L, class Dimensions, class Scale>
+struct heterogeneous_system_impl
+{
+ typedef L type;
+ typedef Dimensions dimensions;
+ typedef Scale scale;
+};
+
+/// INTERNAL ONLY
+typedef dimensionless_type no_scale;
+
+/// A system that can represent any possible combination
+/// of units at the expense of not preserving information
+/// about how it was created. Do not create specializations
+/// of this template directly. Instead use @c reduce_unit and
+/// @c base_unit<...>::unit_type.
+template<class T>
+struct heterogeneous_system : T {};
+
+/// INTERNAL ONLY
+struct heterogeneous_system_dim_tag {};
+
+/// INTERNAL ONLY
+template<class Unit, class Exponent>
+struct heterogeneous_system_dim
+{
+ typedef heterogeneous_system_dim_tag tag;
+ typedef heterogeneous_system_dim type;
+ typedef Unit tag_type;
+ typedef Exponent value_type;
+};
+
+/// INTERNAL ONLY
+#define BOOST_UNITS_MAKE_HETEROGENEOUS_UNIT(BaseUnit, Dimensions) \
+ boost::units::unit< \
+ Dimensions, \
+ boost::units::heterogeneous_system< \
+ boost::units::heterogeneous_system_impl< \
+ boost::units::list< \
+ boost::units::heterogeneous_system_dim< \
+ BaseUnit, \
+ boost::units::static_rational<1> \
+ >, \
+ boost::units::dimensionless_type \
+ >, \
+ Dimensions, \
+ boost::units::no_scale \
+ > \
+ > \
+ >
+
+} // namespace units
+
+} // namespace boost
+
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::heterogeneous_system_impl, (class)(class)(class))
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::heterogeneous_system, (class))
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::heterogeneous_system_dim, (class)(class))
+
+#endif
+
+namespace boost {
+
+namespace mpl {
+
+/// INTERNAL ONLY
+template<>
+struct less_impl<boost::units::heterogeneous_system_dim_tag, boost::units::heterogeneous_system_dim_tag>
+{
+ template<class T0, class T1>
+ struct apply : mpl::less<typename T0::tag_type, typename T1::tag_type> {};
+};
+
+}
+
+namespace units {
+
+namespace detail {
+
+template<class Unit1, class Exponent1>
+struct is_empty_dim<heterogeneous_system_dim<Unit1,Exponent1> > : detail::is_zero<Exponent1> {};
+
+} // namespace detail
+
+} // namespace units
+
+namespace mpl {
+
+/// INTERNAL ONLY
+template<>
+struct plus_impl<boost::units::heterogeneous_system_dim_tag, boost::units::heterogeneous_system_dim_tag>
+{
+ template<class T0, class T1>
+ struct apply
+ {
+ typedef boost::units::heterogeneous_system_dim<
+ typename T0::tag_type,
+ typename mpl::plus<typename T0::value_type,typename T1::value_type>::type
+ > type;
+ };
+};
+
+/// INTERNAL ONLY
+template<>
+struct times_impl<boost::units::heterogeneous_system_dim_tag, boost::units::detail::static_rational_tag>
+{
+ template<class T0, class T1>
+ struct apply
+ {
+ typedef boost::units::heterogeneous_system_dim<
+ typename T0::tag_type,
+ typename mpl::times<typename T0::value_type,T1>::type
+ > type;
+ };
+};
+
+/// INTERNAL ONLY
+template<>
+struct divides_impl<boost::units::heterogeneous_system_dim_tag, boost::units::detail::static_rational_tag>
+{
+ template<class T0, class T1>
+ struct apply
+ {
+ typedef boost::units::heterogeneous_system_dim<
+ typename T0::tag_type,
+ typename mpl::divides<typename T0::value_type,T1>::type
+ > type;
+ };
+};
+
+/// INTERNAL ONLY
+template<>
+struct negate_impl<boost::units::heterogeneous_system_dim_tag>
+{
+ template<class T>
+ struct apply
+ {
+ typedef boost::units::heterogeneous_system_dim<typename T::tag_type, typename mpl::negate<typename T::value_type>::type> type;
+ };
+};
+
+} // namespace mpl
+
+namespace units {
+
+namespace detail {
+
+template<int N>
+struct make_heterogeneous_system_impl
+{
+ template<class UnitsBegin, class ExponentsBegin>
+ struct apply
+ {
+ typedef typename push_front_if<!(is_zero<typename ExponentsBegin::item>::value)>::template apply<
+ typename make_heterogeneous_system_impl<N-1>::template apply<
+ typename UnitsBegin::next,
+ typename ExponentsBegin::next
+ >::type,
+ heterogeneous_system_dim<typename UnitsBegin::item, typename ExponentsBegin::item>
+ >::type type;
+ };
+};
+
+template<>
+struct make_heterogeneous_system_impl<0>
+{
+ template<class UnitsBegin, class ExponentsBegin>
+ struct apply
+ {
+ typedef dimensionless_type type;
+ };
+};
+
+template<class Dimensions, class System>
+struct make_heterogeneous_system
+{
+ typedef typename calculate_base_unit_exponents<typename System::type, Dimensions>::type exponents;
+ BOOST_MPL_ASSERT_MSG((!boost::is_same<exponents, inconsistent>::value), the_specified_dimension_is_not_representible_in_the_given_system, (types<Dimensions, System>));
+ typedef typename make_heterogeneous_system_impl<System::type::size::value>::template apply<
+ typename System::type,
+ exponents
+ >::type unit_list;
+ typedef heterogeneous_system<heterogeneous_system_impl<unit_list, Dimensions, no_scale> > type;
+};
+
+template<class Dimensions, class T>
+struct make_heterogeneous_system<Dimensions, heterogeneous_system<T> >
+{
+ typedef heterogeneous_system<T> type;
+};
+
+template<class T0, class T1>
+struct multiply_systems
+{
+ typedef heterogeneous_system<
+ heterogeneous_system_impl<
+ typename mpl::times<typename T0::type, typename T1::type>::type,
+ typename mpl::times<typename T0::dimensions, typename T1::dimensions>::type,
+ typename mpl::times<typename T0::scale, typename T1::scale>::type
+ >
+ > type;
+};
+
+template<class T0, class T1>
+struct divide_systems
+{
+ typedef heterogeneous_system<
+ heterogeneous_system_impl<
+ typename mpl::divides<typename T0::type, typename T1::type>::type,
+ typename mpl::divides<typename T0::dimensions, typename T1::dimensions>::type,
+ typename mpl::divides<typename T0::scale, typename T1::scale>::type
+ >
+ > type;
+};
+
+} // namespace detail
+
+/// INTERNAL ONLY
+template<class S, long N, long D>
+struct static_power<heterogeneous_system<S>, static_rational<N,D> >
+{
+ typedef heterogeneous_system<
+ heterogeneous_system_impl<
+ typename static_power<typename S::type, static_rational<N,D> >::type,
+ typename static_power<typename S::dimensions, static_rational<N,D> >::type,
+ typename static_power<typename S::scale, static_rational<N,D> >::type
+ >
+ > type;
+};
+
+/// INTERNAL ONLY
+template<class S, long N, long D>
+struct static_root<heterogeneous_system<S>, static_rational<N,D> >
+{
+ typedef heterogeneous_system<
+ heterogeneous_system_impl<
+ typename static_root<typename S::type, static_rational<N,D> >::type,
+ typename static_root<typename S::dimensions, static_rational<N,D> >::type,
+ typename static_root<typename S::scale, static_rational<N,D> >::type
+ >
+ > type;
+};
+
+namespace detail {
+
+template<int N>
+struct unscale_heterogeneous_system_impl
+{
+ template<class Begin>
+ struct apply
+ {
+ typedef typename push_front_or_add<
+ typename unscale_heterogeneous_system_impl<N-1>::template apply<
+ typename Begin::next
+ >::type,
+ typename unscale<typename Begin::item>::type
+ >::type type;
+ };
+};
+
+template<>
+struct unscale_heterogeneous_system_impl<0>
+{
+ template<class Begin>
+ struct apply
+ {
+ typedef dimensionless_type type;
+ };
+};
+
+} // namespace detail
+
+/// Unscale all the base units. e.g
+/// km s -> m s
+/// cm km -> m^2
+/// INTERNAL ONLY
+template<class T>
+struct unscale<heterogeneous_system<T> >
+{
+ typedef heterogeneous_system<
+ heterogeneous_system_impl<
+ typename detail::unscale_heterogeneous_system_impl<
+ T::type::size::value
+ >::template apply<
+ typename T::type
+ >::type,
+ typename T::dimensions,
+ no_scale
+ >
+ > type;
+};
+
+/// INTERNAL ONLY
+template<class Unit, class Exponent>
+struct unscale<heterogeneous_system_dim<Unit, Exponent> >
+{
+ typedef heterogeneous_system_dim<typename unscale<Unit>::type, Exponent> type;
+};
+
+namespace detail {
+
+template<int N>
+struct get_scale_list_of_heterogeneous_system_impl
+{
+ template<class Begin>
+ struct apply
+ {
+ typedef typename mpl::times<
+ typename get_scale_list_of_heterogeneous_system_impl<N-1>::template apply<
+ typename Begin::next
+ >::type,
+ typename get_scale_list<typename Begin::item>::type
+ >::type type;
+ };
+};
+
+template<>
+struct get_scale_list_of_heterogeneous_system_impl<0>
+{
+ template<class Begin>
+ struct apply
+ {
+ typedef dimensionless_type type;
+ };
+};
+
+} // namespace detail
+
+/// INTERNAL ONLY
+template<class T>
+struct get_scale_list<heterogeneous_system<T> >
+{
+ typedef typename mpl::times<
+ typename detail::get_scale_list_of_heterogeneous_system_impl<
+ T::type::size::value
+ >::template apply<typename T::type>::type,
+ typename T::scale
+ >::type type;
+};
+
+/// INTERNAL ONLY
+template<class Unit, class Exponent>
+struct get_scale_list<heterogeneous_system_dim<Unit, Exponent> >
+{
+ typedef typename static_power<typename get_scale_list<Unit>::type, Exponent>::type type;
+};
+
+namespace detail {
+
+template<class System, class Dimension>
+struct check_system : mpl::false_ {};
+
+template<class System, class Dimension, class Scale>
+struct check_system<heterogeneous_system<heterogeneous_system_impl<System, Dimension, Scale> >, Dimension> : mpl::true_ {};
+
+} // namespace detail
+
+} // namespace units
+
+} // namespace boost
+
+#endif
diff --git a/boost/units/homogeneous_system.hpp b/boost/units/homogeneous_system.hpp
new file mode 100644
index 0000000..aa3b056
--- /dev/null
+++ b/boost/units/homogeneous_system.hpp
@@ -0,0 +1,105 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_HOMOGENEOUS_SYSTEM_HPP_INCLUDED
+#define BOOST_UNITS_HOMOGENEOUS_SYSTEM_HPP_INCLUDED
+
+#include <boost/mpl/bool.hpp>
+
+#include <boost/units/config.hpp>
+#include <boost/units/static_rational.hpp>
+
+#ifdef BOOST_UNITS_CHECK_HOMOGENEOUS_UNITS
+
+#include <boost/type_traits/is_same.hpp>
+#include <boost/mpl/not.hpp>
+
+#include <boost/units/detail/linear_algebra.hpp>
+
+#endif
+
+namespace boost {
+
+namespace units {
+
+/// A system that can uniquely represent any unit
+/// which can be composed from a linearly independent set
+/// of base units. It is safe to rebind a unit with
+/// such a system to different dimensions.
+///
+/// Do not construct this template directly. Use
+/// make_system instead.
+template<class L>
+struct homogeneous_system {
+ /// INTERNAL ONLY
+ typedef L type;
+};
+
+template<class T, class E>
+struct static_power;
+
+template<class T, class R>
+struct static_root;
+
+/// INTERNAL ONLY
+template<class L, long N, long D>
+struct static_power<homogeneous_system<L>, static_rational<N,D> >
+{
+ typedef homogeneous_system<L> type;
+};
+
+/// INTERNAL ONLY
+template<class L, long N, long D>
+struct static_root<homogeneous_system<L>, static_rational<N,D> >
+{
+ typedef homogeneous_system<L> type;
+};
+
+namespace detail {
+
+template<class System, class Dimensions>
+struct check_system;
+
+#ifdef BOOST_UNITS_CHECK_HOMOGENEOUS_UNITS
+
+template<class L, class Dimensions>
+struct check_system<homogeneous_system<L>, Dimensions> :
+ boost::mpl::not_<
+ boost::is_same<
+ typename calculate_base_unit_exponents<
+ L,
+ Dimensions
+ >::type,
+ inconsistent
+ >
+ > {};
+
+#else
+
+template<class L, class Dimensions>
+struct check_system<homogeneous_system<L>, Dimensions> : mpl::true_ {};
+
+#endif
+
+} // namespace detail
+
+} // namespace units
+
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::homogeneous_system, (class))
+
+#endif
+
+#endif
diff --git a/boost/units/io.hpp b/boost/units/io.hpp
new file mode 100644
index 0000000..cd49da7
--- /dev/null
+++ b/boost/units/io.hpp
@@ -0,0 +1,1067 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2010 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_IO_HPP
+#define BOOST_UNITS_IO_HPP
+
+/// \file
+/// \brief Stream input and output for rationals, units and quantities.
+/// \details Functions and manipulators for output and input of units and quantities.
+/// symbol and name format, and engineering and binary autoprefix.
+/// Serialization output is also supported.
+
+#include <cassert>
+#include <cmath>
+#include <string>
+#include <iosfwd>
+#include <ios>
+#include <sstream>
+
+#include <boost/serialization/nvp.hpp>
+
+#include <boost/units/units_fwd.hpp>
+#include <boost/units/heterogeneous_system.hpp>
+#include <boost/units/make_scaled_unit.hpp>
+#include <boost/units/quantity.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/unit.hpp>
+#include <boost/units/detail/utility.hpp>
+
+namespace boost {
+
+namespace serialization {
+
+/// Boost Serialization library support for units.
+template<class Archive,class System,class Dim>
+inline void serialize(Archive& ar,boost::units::unit<Dim,System>&,const unsigned int /*version*/)
+{ }
+
+/// Boost Serialization library support for quantities.
+template<class Archive,class Unit,class Y>
+inline void serialize(Archive& ar,boost::units::quantity<Unit,Y>& q,const unsigned int /*version*/)
+{
+ ar & boost::serialization::make_nvp("value", units::quantity_cast<Y&>(q));
+}
+
+} // namespace serialization
+
+namespace units {
+
+// get string representation of arbitrary type.
+template<class T> std::string to_string(const T& t)
+{
+ std::stringstream sstr;
+
+ sstr << t;
+
+ return sstr.str();
+}
+
+/// get string representation of integral-valued @c static_rational.
+template<integer_type N> std::string to_string(const static_rational<N>&)
+{
+ return to_string(N);
+}
+
+/// get string representation of @c static_rational.
+template<integer_type N, integer_type D> std::string to_string(const static_rational<N,D>&)
+{
+ return '(' + to_string(N) + '/' + to_string(D) + ')';
+}
+
+/// Write @c static_rational to @c std::basic_ostream.
+template<class Char, class Traits, integer_type N, integer_type D>
+inline std::basic_ostream<Char, Traits>& operator<<(std::basic_ostream<Char, Traits>& os,const static_rational<N,D>& r)
+{
+ os << to_string(r);
+ return os;
+}
+
+/// traits template for unit names.
+template<class BaseUnit>
+struct base_unit_info
+{
+ /// INTERNAL ONLY
+ typedef void base_unit_info_primary_template;
+ /// The full name of the unit (returns BaseUnit::name() by default)
+ static std::string name()
+ {
+ return(BaseUnit::name());
+ }
+ /// The symbol for the base unit (Returns BaseUnit::symbol() by default)
+ static std::string symbol()
+ {
+ return(BaseUnit::symbol()); /// \returns BaseUnit::symbol(), for example "m"
+ }
+};
+
+/// \enum format_mode format of output of units, for example "m" or "meter".
+enum format_mode
+{
+ symbol_fmt = 0, /// default - reduces unit names to known symbols for both base and derived units.
+ name_fmt = 1, /// output full unit names for base and derived units, for example "meter".
+ raw_fmt = 2, /// output only symbols for base units (but not derived units), for example "m".
+ typename_fmt = 3, /// output demangled typenames (useful only for diagnosis).
+ fmt_mask = 3 /// Bits used for format.
+};
+
+/// \enum autoprefix_mode automatic scaling and prefix (controlled by value of quantity) a, if any,
+enum autoprefix_mode
+{
+ autoprefix_none = 0, /// No automatic prefix.
+ autoprefix_engineering = 4, /// Scale and prefix with 10^3 multiples, 1234.5 m output as 1.2345 km.
+ autoprefix_binary = 8, /// Scale and prefix with 2^10 (1024) multiples, 1024 as 1 kb.
+ autoprefix_mask = 12 /// Bits used for autoprefix.
+};
+
+namespace detail {
+
+template<bool>
+struct xalloc_key_holder
+{
+ static int value;
+ static bool initialized;
+};
+
+template<bool b>
+int xalloc_key_holder<b>::value = 0;
+
+template<bool b>
+bool xalloc_key_holder<b>::initialized = 0;
+
+struct xalloc_key_initializer_t
+{
+ xalloc_key_initializer_t()
+ {
+ if (!xalloc_key_holder<true>::initialized)
+ {
+ xalloc_key_holder<true>::value = std::ios_base::xalloc();
+ xalloc_key_holder<true>::initialized = true;
+ }
+ }
+};
+
+namespace /**/ {
+
+xalloc_key_initializer_t xalloc_key_initializer;
+
+} // namespace
+
+} // namespace detail
+
+/// returns flags controlling output.
+inline long get_flags(std::ios_base& ios, long mask)
+{
+ return(ios.iword(detail::xalloc_key_holder<true>::value) & mask);
+}
+
+/// Set new flags controlling output format.
+inline void set_flags(std::ios_base& ios, long new_flags, long mask)
+{
+ assert((~mask & new_flags) == 0);
+ long& flags = ios.iword(detail::xalloc_key_holder<true>::value);
+ flags = (flags & ~mask) | new_flags;
+}
+
+/// returns flags controlling output format.
+inline format_mode get_format(std::ios_base& ios)
+{
+ return(static_cast<format_mode>((get_flags)(ios, fmt_mask)));
+}
+
+/// Set new flags controlling output format.
+inline void set_format(std::ios_base& ios, format_mode new_mode)
+{
+ (set_flags)(ios, new_mode, fmt_mask);
+}
+
+/// Set new flags for type_name output format.
+inline std::ios_base& typename_format(std::ios_base& ios)
+{
+ (set_format)(ios, typename_fmt);
+ return(ios);
+}
+
+/// set new flag for raw format output, for example "m".
+inline std::ios_base& raw_format(std::ios_base& ios)
+{
+ (set_format)(ios, raw_fmt);
+ return(ios);
+}
+
+/// set new format flag for symbol output, for example "m".
+inline std::ios_base& symbol_format(std::ios_base& ios)
+{
+ (set_format)(ios, symbol_fmt);
+ return(ios);
+}
+
+/// set new format for name output, for example "meter".
+inline std::ios_base& name_format(std::ios_base& ios)
+{
+ (set_format)(ios, name_fmt);
+ return(ios);
+}
+
+/// get autoprefix flags for output.
+inline autoprefix_mode get_autoprefix(std::ios_base& ios)
+{
+ return static_cast<autoprefix_mode>((get_flags)(ios, autoprefix_mask));
+}
+
+/// Get format for output.
+inline void set_autoprefix(std::ios_base& ios, autoprefix_mode new_mode)
+{
+ (set_flags)(ios, new_mode, autoprefix_mask);
+}
+
+/// Clear autoprefix flags.
+inline std::ios_base& no_prefix(std::ios_base& ios)
+{
+ (set_autoprefix)(ios, autoprefix_none);
+ return ios;
+}
+
+/// Set flag for engineering prefix, so 1234.5 m displays as "1.2345 km".
+inline std::ios_base& engineering_prefix(std::ios_base& ios)
+{
+ (set_autoprefix)(ios, autoprefix_engineering);
+ return ios;
+}
+
+/// Set flag for binary prefix, so 1024 byte displays as "1 Kib".
+inline std::ios_base& binary_prefix(std::ios_base& ios)
+{
+ (set_autoprefix)(ios, autoprefix_binary);
+ return ios;
+}
+
+namespace detail {
+
+/// \return exponent string like "^1/2".
+template<integer_type N, integer_type D>
+inline std::string exponent_string(const static_rational<N,D>& r)
+{
+ return '^' + to_string(r);
+}
+
+/// \return empty exponent string for integer rational like 2.
+template<>
+inline std::string exponent_string(const static_rational<1>&)
+{
+ return "";
+}
+
+template<class T>
+inline std::string base_unit_symbol_string(const T&)
+{
+ return base_unit_info<typename T::tag_type>::symbol() + exponent_string(typename T::value_type());
+}
+
+template<class T>
+inline std::string base_unit_name_string(const T&)
+{
+ return base_unit_info<typename T::tag_type>::name() + exponent_string(typename T::value_type());
+}
+
+// stringify with symbols.
+template<int N>
+struct symbol_string_impl
+{
+ template<class Begin>
+ struct apply
+ {
+ typedef typename symbol_string_impl<N-1>::template apply<typename Begin::next> next;
+ static void value(std::string& str)
+ {
+ str += base_unit_symbol_string(typename Begin::item()) + ' ';
+ next::value(str);
+ }
+ };
+};
+
+template<>
+struct symbol_string_impl<1>
+{
+ template<class Begin>
+ struct apply
+ {
+ static void value(std::string& str)
+ {
+ str += base_unit_symbol_string(typename Begin::item());
+ };
+ };
+};
+
+template<>
+struct symbol_string_impl<0>
+{
+ template<class Begin>
+ struct apply
+ {
+ static void value(std::string& str)
+ {
+ // better shorthand for dimensionless?
+ str += "dimensionless";
+ }
+ };
+};
+
+template<int N>
+struct scale_symbol_string_impl
+{
+ template<class Begin>
+ struct apply
+ {
+ static void value(std::string& str)
+ {
+ str += Begin::item::symbol();
+ scale_symbol_string_impl<N - 1>::template apply<typename Begin::next>::value(str);
+ }
+ };
+};
+
+template<>
+struct scale_symbol_string_impl<0>
+{
+ template<class Begin>
+ struct apply
+ {
+ static void value(std::string&) { }
+ };
+};
+
+// stringify with names.
+template<int N>
+struct name_string_impl
+{
+ template<class Begin>
+ struct apply
+ {
+ typedef typename name_string_impl<N-1>::template apply<typename Begin::next> next;
+ static void value(std::string& str)
+ {
+ str += base_unit_name_string(typename Begin::item()) + ' ';
+ next::value(str);
+ }
+ };
+};
+
+template<>
+struct name_string_impl<1>
+{
+ template<class Begin>
+ struct apply
+ {
+ static void value(std::string& str)
+ {
+ str += base_unit_name_string(typename Begin::item());
+ };
+ };
+};
+
+template<>
+struct name_string_impl<0>
+{
+ template<class Begin>
+ struct apply
+ {
+ static void value(std::string& str)
+ {
+ str += "dimensionless";
+ }
+ };
+};
+
+template<int N>
+struct scale_name_string_impl
+{
+ template<class Begin>
+ struct apply
+ {
+ static void value(std::string& str)
+ {
+ str += Begin::item::name();
+ scale_name_string_impl<N - 1>::template apply<typename Begin::next>::value(str);
+ }
+ };
+};
+
+template<>
+struct scale_name_string_impl<0>
+{
+ template<class Begin>
+ struct apply
+ {
+ static void value(std::string&) { }
+ };
+};
+
+} // namespace detail
+
+namespace detail {
+
+// These two overloads of symbol_string and name_string will
+// will pick up homogeneous_systems. They simply call the
+// appropriate function with a heterogeneous_system.
+template<class Dimension,class System, class SubFormatter>
+inline std::string
+to_string_impl(const unit<Dimension,System>&, SubFormatter f)
+{
+ return f(typename reduce_unit<unit<Dimension, System> >::type());
+}
+
+/// INTERNAL ONLY
+// this overload picks up heterogeneous units that are not scaled.
+template<class Dimension,class Units, class Subformatter>
+inline std::string
+to_string_impl(const unit<Dimension, heterogeneous_system<heterogeneous_system_impl<Units, Dimension, dimensionless_type> > >&, Subformatter f)
+{
+ std::string str;
+ f.template append_units_to<Units>(str);
+ return(str);
+}
+
+// This overload is a special case for heterogeneous_system which
+// is really unitless
+/// INTERNAL ONLY
+template<class Subformatter>
+inline std::string
+to_string_impl(const unit<dimensionless_type, heterogeneous_system<heterogeneous_system_impl<dimensionless_type, dimensionless_type, dimensionless_type> > >&, Subformatter)
+{
+ return("dimensionless");
+}
+
+// this overload deals with heterogeneous_systems which are unitless
+// but scaled.
+/// INTERNAL ONLY
+template<class Scale, class Subformatter>
+inline std::string
+to_string_impl(const unit<dimensionless_type, heterogeneous_system<heterogeneous_system_impl<dimensionless_type, dimensionless_type, Scale> > >&, Subformatter f)
+{
+ std::string str;
+ f.template append_scale_to<Scale>(str);
+ return(str);
+}
+
+// this overload deals with scaled units.
+/// INTERNAL ONLY
+template<class Dimension,class Units,class Scale, class Subformatter>
+inline std::string
+to_string_impl(const unit<Dimension, heterogeneous_system<heterogeneous_system_impl<Units, Dimension, Scale> > >&, Subformatter f)
+{
+ std::string str;
+
+ f.template append_scale_to<Scale>(str);
+
+ std::string without_scale = f(unit<Dimension, heterogeneous_system<heterogeneous_system_impl<Units, Dimension, dimensionless_type> > >());
+
+ if (f.is_default_string(without_scale, unit<Dimension, heterogeneous_system<heterogeneous_system_impl<Units, Dimension, dimensionless_type> > >()))
+ {
+ str += "(";
+ str += without_scale;
+ str += ")";
+ }
+ else
+ {
+ str += without_scale;
+ }
+
+ return(str);
+}
+
+// This overload catches scaled units that have a single base unit
+// raised to the first power. It causes si::nano * si::meters to not
+// put parentheses around the meters. i.e. nm rather than n(m)
+/// INTERNAL ONLY
+template<class Dimension,class Unit,class Scale, class Subformatter>
+inline std::string
+to_string_impl(const unit<Dimension, heterogeneous_system<heterogeneous_system_impl<list<heterogeneous_system_dim<Unit, static_rational<1> >,dimensionless_type>, Dimension, Scale> > >&, Subformatter f)
+{
+ std::string str;
+
+ f.template append_scale_to<Scale>(str);
+ str += f(unit<Dimension, heterogeneous_system<heterogeneous_system_impl<list<heterogeneous_system_dim<Unit, static_rational<1> >, dimensionless_type>, Dimension, dimensionless_type> > >());
+
+ return(str);
+}
+
+// This overload is necessary to disambiguate.
+// it catches units that are unscaled and have a single
+// base unit raised to the first power. It is treated the
+// same as any other unscaled unit.
+/// INTERNAL ONLY
+template<class Dimension,class Unit,class Subformatter>
+inline std::string
+to_string_impl(const unit<Dimension, heterogeneous_system<heterogeneous_system_impl<list<heterogeneous_system_dim<Unit, static_rational<1> >,dimensionless_type>, Dimension, dimensionless_type> > >&, Subformatter f)
+{
+ std::string str;
+ f.template append_units_to<list<heterogeneous_system_dim<Unit, static_rational<1> >,dimensionless_type> >(str);
+ return(str);
+}
+
+// This overload catches scaled units that have a single scaled base unit
+// raised to the first power. It moves that scaling on the base unit
+// to the unit level scaling and recurses. By doing this we make sure that
+// si::milli * si::kilograms will print g rather than mkg.
+//
+// This transformation will not be applied if base_unit_info is specialized
+// for the scaled base unit.
+//
+/// INTERNAL ONLY
+template<class Dimension,class Unit,class UnitScale, class Scale, class Subformatter>
+inline std::string
+to_string_impl(
+ const unit<
+ Dimension,
+ heterogeneous_system<
+ heterogeneous_system_impl<
+ list<heterogeneous_system_dim<scaled_base_unit<Unit, UnitScale>, static_rational<1> >, dimensionless_type>,
+ Dimension,
+ Scale
+ >
+ >
+ >&,
+ Subformatter f,
+ typename base_unit_info<scaled_base_unit<Unit, UnitScale> >::base_unit_info_primary_template* = 0)
+{
+ return(f(
+ unit<
+ Dimension,
+ heterogeneous_system<
+ heterogeneous_system_impl<
+ list<heterogeneous_system_dim<Unit, static_rational<1> >, dimensionless_type>,
+ Dimension,
+ typename mpl::times<Scale, list<scale_list_dim<UnitScale>, dimensionless_type> >::type
+ >
+ >
+ >()));
+}
+
+// this overload disambuguates between the overload for an unscaled unit
+// and the overload for a scaled base unit raised to the first power.
+/// INTERNAL ONLY
+template<class Dimension,class Unit,class UnitScale,class Subformatter>
+inline std::string
+to_string_impl(
+ const unit<
+ Dimension,
+ heterogeneous_system<
+ heterogeneous_system_impl<
+ list<heterogeneous_system_dim<scaled_base_unit<Unit, UnitScale>, static_rational<1> >, dimensionless_type>,
+ Dimension,
+ dimensionless_type
+ >
+ >
+ >&,
+ Subformatter f,
+ typename base_unit_info<scaled_base_unit<Unit, UnitScale> >::base_unit_info_primary_template* = 0)
+{
+ std::string str;
+ f.template append_units_to<list<heterogeneous_system_dim<scaled_base_unit<Unit, UnitScale>, static_rational<1> >, dimensionless_type> >(str);
+ return(str);
+}
+
+struct format_raw_symbol_impl {
+ template<class Units>
+ void append_units_to(std::string& str) {
+ detail::symbol_string_impl<Units::size::value>::template apply<Units>::value(str);
+ }
+ template<class Scale>
+ void append_scale_to(std::string& str) {
+ detail::scale_symbol_string_impl<Scale::size::value>::template apply<Scale>::value(str);
+ }
+ template<class Unit>
+ std::string operator()(const Unit& u) {
+ return(to_string_impl(u, *this));
+ }
+ template<class Unit>
+ bool is_default_string(const std::string&, const Unit&) {
+ return(true);
+ }
+};
+
+struct format_symbol_impl : format_raw_symbol_impl {
+ template<class Unit>
+ std::string operator()(const Unit& u) {
+ return(symbol_string(u));
+ }
+ template<class Unit>
+ bool is_default_string(const std::string& str, const Unit& u) {
+ return(str == to_string_impl(u, format_raw_symbol_impl()));
+ }
+};
+
+struct format_raw_name_impl {
+ template<class Units>
+ void append_units_to(std::string& str) {
+ detail::name_string_impl<(Units::size::value)>::template apply<Units>::value(str);
+ }
+ template<class Scale>
+ void append_scale_to(std::string& str) {
+ detail::scale_name_string_impl<Scale::size::value>::template apply<Scale>::value(str);
+ }
+ template<class Unit>
+ std::string operator()(const Unit& u) {
+ return(to_string_impl(u, *this));
+ }
+ template<class Unit>
+ bool is_default_string(const std::string&, const Unit&) {
+ return(true);
+ }
+};
+
+struct format_name_impl : format_raw_name_impl {
+ template<class Unit>
+ std::string operator()(const Unit& u) {
+ return(name_string(u));
+ }
+ template<class Unit>
+ bool is_default_string(const std::string& str, const Unit& u) {
+ return(str == to_string_impl(u, format_raw_name_impl()));
+ }
+};
+
+template<class Char, class Traits>
+inline void do_print(std::basic_ostream<Char, Traits>& os, const std::string& s)
+{
+ os << s.c_str();
+}
+
+inline void do_print(std::ostream& os, const std::string& s)
+{
+ os << s;
+}
+
+template<class Char, class Traits>
+inline void do_print(std::basic_ostream<Char, Traits>& os, const char* s)
+{
+ os << s;
+}
+
+// For automatically applying the appropriate prefixes.
+
+}
+
+#ifdef BOOST_UNITS_DOXYGEN
+
+/// ADL customization point for automatic prefixing.
+/// Returns a non-negative value. Implemented as std::abs
+/// for built-in types.
+template<class T>
+double autoprefix_norm(const T& arg);
+
+#else
+
+template<class T, bool C = boost::is_arithmetic<T>::value>
+struct autoprefix_norm_impl;
+
+template<class T>
+struct autoprefix_norm_impl<T, true>
+{
+ typedef double type;
+ static double call(const T& arg) { return std::abs(arg); }
+};
+
+template<class T>
+struct autoprefix_norm_impl<T, false>
+{
+ typedef one type;
+ static one call(const T&) { return one(); }
+};
+
+template<class T>
+typename autoprefix_norm_impl<T>::type autoprefix_norm(const T& arg)
+{
+ return autoprefix_norm_impl<T>::call(arg);
+}
+
+#endif
+
+namespace detail {
+
+template<class End, class Prev, class T, class F>
+bool find_matching_scale_impl(End, End, Prev, T, double, F)
+{
+ return false;
+}
+
+template<class Begin, class End, class Prev, class T, class F>
+bool find_matching_scale_impl(Begin, End end, Prev prev, T t, double x, F f)
+{
+ if(Begin::item::value() > x) {
+ f(prev, t);
+ return true;
+ } else {
+ return detail::find_matching_scale_impl(
+ typename Begin::next(),
+ end,
+ typename Begin::item(),
+ t,
+ x,
+ f
+ );
+ }
+}
+
+template<class End, class T, class F>
+bool find_matching_scale_i(End, End, T, double, F)
+{
+ return false;
+}
+
+template<class Begin, class End, class T, class F>
+bool find_matching_scale_i(Begin, End end, T t, double x, F f)
+{
+ if(Begin::item::value() > x) {
+ return false;
+ } else {
+ return detail::find_matching_scale_impl(typename Begin::next(), end, typename Begin::item(), t, x, f);
+ }
+}
+
+template<class Scales, class T, class F>
+bool find_matching_scale(T t, double x, F f)
+{
+ return detail::find_matching_scale_i(Scales(), dimensionless_type(), t, x, f);
+}
+
+typedef list<scale<10, static_rational<-24> >,
+ list<scale<10, static_rational<-21> >,
+ list<scale<10, static_rational<-18> >,
+ list<scale<10, static_rational<-15> >,
+ list<scale<10, static_rational<-12> >,
+ list<scale<10, static_rational<-9> >,
+ list<scale<10, static_rational<-6> >,
+ list<scale<10, static_rational<-3> >,
+ list<scale<10, static_rational<0> >,
+ list<scale<10, static_rational<3> >,
+ list<scale<10, static_rational<6> >,
+ list<scale<10, static_rational<9> >,
+ list<scale<10, static_rational<12> >,
+ list<scale<10, static_rational<15> >,
+ list<scale<10, static_rational<18> >,
+ list<scale<10, static_rational<21> >,
+ list<scale<10, static_rational<24> >,
+ list<scale<10, static_rational<27> >,
+ dimensionless_type> > > > > > > > > > > > > > > > > > engineering_prefixes;
+
+typedef list<scale<2, static_rational<10> >,
+ list<scale<2, static_rational<20> >,
+ list<scale<2, static_rational<30> >,
+ list<scale<2, static_rational<40> >,
+ list<scale<2, static_rational<50> >,
+ list<scale<2, static_rational<60> >,
+ list<scale<2, static_rational<70> >,
+ dimensionless_type> > > > > > > binary_prefixes;
+
+template<class Os, class Quantity>
+struct print_default_t {
+ typedef void result_type;
+ void operator()() const
+ {
+ *os << q->value() << ' ' << typename Quantity::unit_type();
+ }
+ Os* os;
+ const Quantity* q;
+};
+
+template<class Os, class Quantity>
+print_default_t<Os, Quantity> print_default(Os& os, const Quantity& q)
+{
+ print_default_t<Os, Quantity> result = { &os, &q };
+ return result;
+}
+
+template<class Os>
+struct print_scale_t {
+ typedef void result_type;
+ template<class Prefix, class T>
+ void operator()(Prefix, const T& t) const
+ {
+ *prefixed = true;
+ *os << t / Prefix::value() << ' ';
+ switch(units::get_format(*os)) {
+ case name_fmt: do_print(*os, Prefix::name()); break;
+ case raw_fmt:
+ case symbol_fmt: do_print(*os, Prefix::symbol()); break;
+ case typename_fmt: do_print(*os, units::simplify_typename(Prefix())); *os << ' '; break;
+ }
+ }
+ template<long N, class T>
+ void operator()(scale<N, static_rational<0> >, const T& t) const
+ {
+ *prefixed = false;
+ *os << t << ' ';
+ }
+ Os* os;
+ bool* prefixed;
+};
+
+template<class Os>
+print_scale_t<Os> print_scale(Os& os, bool& prefixed)
+{
+ print_scale_t<Os> result = { &os, &prefixed };
+ return result;
+}
+
+// puts parentheses around a unit
+/// INTERNAL ONLY
+template<class Dimension,class Units,class Scale, class Subformatter>
+inline std::string
+maybe_parenthesize(const unit<Dimension, heterogeneous_system<heterogeneous_system_impl<Units, Dimension, Scale> > >&, Subformatter f)
+{
+ std::string str;
+
+ std::string without_scale = f(unit<Dimension, heterogeneous_system<heterogeneous_system_impl<Units, Dimension, dimensionless_type> > >());
+
+ if (f.is_default_string(without_scale, unit<Dimension, heterogeneous_system<heterogeneous_system_impl<Units, Dimension, dimensionless_type> > >()))
+ {
+ str += "(";
+ str += without_scale;
+ str += ")";
+ }
+ else
+ {
+ str += without_scale;
+ }
+
+ return(str);
+}
+
+// This overload catches scaled units that have a single base unit
+// raised to the first power. It causes si::nano * si::meters to not
+// put parentheses around the meters. i.e. nm rather than n(m)
+/// INTERNAL ONLY
+template<class Dimension,class Unit,class Scale, class Subformatter>
+inline std::string
+maybe_parenthesize(const unit<Dimension, heterogeneous_system<heterogeneous_system_impl<list<heterogeneous_system_dim<Unit, static_rational<1> >,dimensionless_type>, Dimension, Scale> > >&, Subformatter f)
+{
+ return f(unit<Dimension, heterogeneous_system<heterogeneous_system_impl<list<heterogeneous_system_dim<Unit, static_rational<1> >, dimensionless_type>, Dimension, dimensionless_type> > >());
+}
+
+template<class Prefixes, class CharT, class Traits, class Unit, class T, class F>
+void do_print_prefixed_impl(std::basic_ostream<CharT, Traits>& os, const quantity<Unit, T>& q, F default_)
+{
+ bool prefixed;
+ if(detail::find_matching_scale<Prefixes>(q.value(), autoprefix_norm(q.value()), detail::print_scale(os, prefixed))) {
+ if(prefixed) {
+ switch(units::get_format(os)) {
+ case symbol_fmt: do_print(os, maybe_parenthesize(Unit(), format_symbol_impl())); break;
+ case raw_fmt: do_print(os, maybe_parenthesize(Unit(), format_raw_symbol_impl())); break;
+ case name_fmt: do_print(os, maybe_parenthesize(Unit(), format_name_impl())); break;
+ case typename_fmt: do_print(os, simplify_typename(Unit())); break;
+ }
+ } else {
+ os << Unit();
+ }
+ } else {
+ default_();
+ }
+}
+
+// Handle units like si::kilograms that have a scale embedded in the
+// base unit. This overload is disabled if the scaled base unit has
+// a user-defined string representation.
+template<class Prefixes, class CharT, class Traits, class Dimension, class BaseUnit, class BaseScale, class Scale, class T>
+typename base_unit_info<
+ scaled_base_unit<BaseUnit, Scale>
+>::base_unit_info_primary_template
+do_print_prefixed(
+ std::basic_ostream<CharT, Traits>& os,
+ const quantity<
+ unit<
+ Dimension,
+ heterogeneous_system<
+ heterogeneous_system_impl<
+ list<
+ heterogeneous_system_dim<
+ scaled_base_unit<BaseUnit, BaseScale>,
+ static_rational<1>
+ >,
+ dimensionless_type
+ >,
+ Dimension,
+ Scale
+ >
+ >
+ >,
+ T
+ >& q)
+{
+ quantity<
+ unit<
+ Dimension,
+ heterogeneous_system<
+ heterogeneous_system_impl<
+ list<
+ heterogeneous_system_dim<BaseUnit, static_rational<1> >,
+ dimensionless_type
+ >,
+ Dimension,
+ dimensionless_type
+ >
+ >
+ >,
+ T
+ > unscaled(q);
+ detail::do_print_prefixed_impl<Prefixes>(os, unscaled, detail::print_default(os, q));
+}
+
+template<class Prefixes, class CharT, class Traits, class Dimension, class L, class Scale, class T>
+void do_print_prefixed(
+ std::basic_ostream<CharT, Traits>& os,
+ const quantity<
+ unit<
+ Dimension,
+ heterogeneous_system<
+ heterogeneous_system_impl<
+ L,
+ Dimension,
+ Scale
+ >
+ >
+ >,
+ T
+ >& q)
+{
+ quantity<
+ unit<
+ Dimension,
+ heterogeneous_system<
+ heterogeneous_system_impl<
+ L,
+ Dimension,
+ dimensionless_type
+ >
+ >
+ >,
+ T
+ > unscaled(q);
+ detail::do_print_prefixed_impl<Prefixes>(os, unscaled, detail::print_default(os, q));
+}
+
+template<class Prefixes, class CharT, class Traits, class Dimension, class System, class T>
+void do_print_prefixed(std::basic_ostream<CharT, Traits>& os, const quantity<unit<Dimension, System>, T>& q)
+{
+ detail::do_print_prefixed<Prefixes>(os, quantity<unit<Dimension, typename make_heterogeneous_system<Dimension, System>::type>, T>(q));
+}
+
+template<class Prefixes, class CharT, class Traits, class Unit, class T>
+void do_print_prefixed(std::basic_ostream<CharT, Traits>& os, const quantity<Unit, T>& q)
+{
+ detail::print_default(os, q)();
+}
+
+template<class Prefixes, class CharT, class Traits, class Unit, class T>
+void maybe_print_prefixed(std::basic_ostream<CharT, Traits>& os, const quantity<Unit, T>& q, mpl::true_)
+{
+ detail::do_print_prefixed<Prefixes>(os, q);
+}
+
+template<class Prefixes, class CharT, class Traits, class Unit, class T>
+void maybe_print_prefixed(std::basic_ostream<CharT, Traits>& os, const quantity<Unit, T>& q, mpl::false_)
+{
+ detail::print_default(os, q)();
+}
+
+inline mpl::true_ test_norm(double) { return mpl::true_(); }
+inline mpl::false_ test_norm(one) { return mpl::false_(); }
+
+} // namespace detail
+
+template<class Dimension,class System>
+inline std::string
+typename_string(const unit<Dimension, System>&)
+{
+ return simplify_typename(typename reduce_unit< unit<Dimension,System> >::type());
+}
+
+template<class Dimension,class System>
+inline std::string
+symbol_string(const unit<Dimension, System>&)
+{
+ return detail::to_string_impl(unit<Dimension,System>(), detail::format_symbol_impl());
+}
+
+template<class Dimension,class System>
+inline std::string
+name_string(const unit<Dimension, System>&)
+{
+ return detail::to_string_impl(unit<Dimension,System>(), detail::format_name_impl());
+}
+
+/// Print a @c unit as a list of base units and their exponents.
+///
+/// for @c symbol_format outputs e.g. "m s^-1" or "J".
+/// for @c name_format outputs e.g. "meter second^-1" or "joule".
+/// for @c raw_format outputs e.g. "m s^-1" or "meter kilogram^2 second^-2".
+/// for @c typename_format outputs the typename itself (currently demangled only on GCC).
+template<class Char, class Traits, class Dimension, class System>
+inline std::basic_ostream<Char, Traits>& operator<<(std::basic_ostream<Char, Traits>& os, const unit<Dimension, System>& u)
+{
+ if (units::get_format(os) == typename_fmt)
+ {
+ detail::do_print(os, typename_string(u));
+ }
+ else if (units::get_format(os) == raw_fmt)
+ {
+ detail::do_print(os, detail::to_string_impl(u, detail::format_raw_symbol_impl()));
+ }
+ else if (units::get_format(os) == symbol_fmt)
+ {
+ detail::do_print(os, symbol_string(u));
+ }
+ else if (units::get_format(os) == name_fmt)
+ {
+ detail::do_print(os, name_string(u));
+ }
+ else
+ {
+ assert(!"The format mode must be one of: typename_format, raw_format, name_format, symbol_format");
+ }
+
+ return(os);
+}
+
+/// \brief Print a @c quantity.
+/// \details Prints the value followed by the unit.
+/// If the engineering_prefix, or binary_prefix is set,
+/// tries to scale the value appropriately.
+/// For example, it might print 12.345 km instead of 12345 m.
+/// (Note does @b not attempt to automatically scale scalars like double, float...)
+template<class Char, class Traits, class Unit, class T>
+inline std::basic_ostream<Char, Traits>& operator<<(std::basic_ostream<Char, Traits>& os, const quantity<Unit, T>& q)
+{
+ if (units::get_autoprefix(os) == autoprefix_none)
+ {
+ os << q.value() << ' ' << Unit();
+ }
+ else if (units::get_autoprefix(os) == autoprefix_engineering)
+ {
+ detail::maybe_print_prefixed<detail::engineering_prefixes>(os, q, detail::test_norm(autoprefix_norm(q.value())));
+ }
+ else if (units::get_autoprefix(os) == autoprefix_binary)
+ {
+ detail::maybe_print_prefixed<detail::binary_prefixes>(os, q, detail::test_norm(autoprefix_norm(q.value())));
+ }
+ else
+ {
+ assert(!"Autoprefixing must be one of: no_prefix, engineering_prefix, binary_prefix");
+ }
+ return(os);
+}
+
+} // namespace units
+
+} // namespace boost
+
+#endif
diff --git a/boost/units/is_dim.hpp b/boost/units/is_dim.hpp
new file mode 100644
index 0000000..d6a6b54
--- /dev/null
+++ b/boost/units/is_dim.hpp
@@ -0,0 +1,42 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_IS_DIM_HPP
+#define BOOST_UNITS_IS_DIM_HPP
+
+///
+/// \file
+/// \brief Check that a type is a valid @c dim.
+///
+
+#include <boost/mpl/bool.hpp>
+
+#include <boost/units/units_fwd.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// Check that a type is a valid @c dim.
+template<typename T>
+struct is_dim :
+ public mpl::false_
+{ };
+
+template<typename T,typename V>
+struct is_dim< dim<T,V> > :
+ public mpl::true_
+{ };
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_IS_DIM_HPP
diff --git a/boost/units/is_dimension_list.hpp b/boost/units/is_dimension_list.hpp
new file mode 100644
index 0000000..b2494d7
--- /dev/null
+++ b/boost/units/is_dimension_list.hpp
@@ -0,0 +1,47 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_IS_DIMENSION_LIST_HPP
+#define BOOST_UNITS_IS_DIMENSION_LIST_HPP
+
+///
+/// \file
+/// \brief Check that a type is a valid dimension list.
+///
+
+#include <boost/mpl/bool.hpp>
+
+#include <boost/units/units_fwd.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// Check that a type is a valid dimension list.
+template<typename Seq>
+struct is_dimension_list :
+ public mpl::false_
+{ };
+
+template<typename Item, typename Next>
+struct is_dimension_list<list<Item, Next> > :
+ public mpl::true_
+{ };
+
+template<>
+struct is_dimension_list<dimensionless_type> :
+ public mpl::true_
+{ };
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_IS_DIMENSION_LIST_HPP
diff --git a/boost/units/is_dimensionless.hpp b/boost/units/is_dimensionless.hpp
new file mode 100644
index 0000000..158a420
--- /dev/null
+++ b/boost/units/is_dimensionless.hpp
@@ -0,0 +1,47 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_IS_DIMENSIONLESS_HPP
+#define BOOST_UNITS_IS_DIMENSIONLESS_HPP
+
+///
+/// \file
+/// \brief Check if a unit or quantity is dimensionless.
+///
+
+#include <boost/mpl/bool.hpp>
+#include <boost/units/units_fwd.hpp>
+
+namespace boost {
+
+namespace units {
+
+template<class T>
+struct is_dimensionless :
+ public mpl::false_
+{ };
+
+/// Check if a unit is dimensionless.
+template<class System>
+struct is_dimensionless< unit<dimensionless_type,System> > :
+ public mpl::true_
+{ };
+
+/// Check if a quantity is dimensionless.
+template<class Unit,class Y>
+struct is_dimensionless< quantity<Unit,Y> > :
+ public is_dimensionless<Unit>
+{ };
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_IS_DIMENSIONLESS_HPP
diff --git a/boost/units/is_dimensionless_quantity.hpp b/boost/units/is_dimensionless_quantity.hpp
new file mode 100644
index 0000000..fa0dbce
--- /dev/null
+++ b/boost/units/is_dimensionless_quantity.hpp
@@ -0,0 +1,34 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_IS_DIMENSIONLESS_QUANTITY_HPP
+#define BOOST_UNITS_IS_DIMENSIONLESS_QUANTITY_HPP
+
+/// \file
+/// \brief check that a type is a dimensionless quantity
+
+#include <boost/units/is_quantity_of_dimension.hpp>
+#include <boost/units/units_fwd.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// Check that a type is a dimensionless quantity.
+template<class T>
+struct is_dimensionless_quantity :
+ public is_quantity_of_dimension<T,dimensionless_type>
+{ };
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_IS_DIMENSIONLESS_QUANTITY_HPP
diff --git a/boost/units/is_dimensionless_unit.hpp b/boost/units/is_dimensionless_unit.hpp
new file mode 100644
index 0000000..09d4da5
--- /dev/null
+++ b/boost/units/is_dimensionless_unit.hpp
@@ -0,0 +1,34 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_IS_DIMENSIONLESS_UNIT_HPP
+#define BOOST_UNITS_IS_DIMENSIONLESS_UNIT_HPP
+
+/// \file
+/// \brief Check that a type is a dimensionless unit.
+
+#include <boost/units/is_unit_of_dimension.hpp>
+#include <boost/units/units_fwd.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// Check that a type is a dimensionless unit.
+template<class T>
+struct is_dimensionless_unit :
+ public is_unit_of_dimension<T,dimensionless_type>
+{ };
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_IS_DIMENSIONLESS_UNIT_HPP
diff --git a/boost/units/is_quantity.hpp b/boost/units/is_quantity.hpp
new file mode 100644
index 0000000..dd0ae08
--- /dev/null
+++ b/boost/units/is_quantity.hpp
@@ -0,0 +1,42 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_IS_QUANTITY_HPP
+#define BOOST_UNITS_IS_QUANTITY_HPP
+
+///
+/// \file
+/// \brief Check that a type is a quantity.
+///
+
+#include <boost/mpl/bool.hpp>
+#include <boost/units/units_fwd.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// Check that a type is a quantity.
+template<typename T>
+struct is_quantity :
+ public mpl::false_
+{ };
+
+template<class Unit,
+ class Y>
+struct is_quantity< quantity<Unit,Y> > :
+ public mpl::true_
+{ };
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_IS_QUANTITY_HPP
diff --git a/boost/units/is_quantity_of_dimension.hpp b/boost/units/is_quantity_of_dimension.hpp
new file mode 100644
index 0000000..f3ec409
--- /dev/null
+++ b/boost/units/is_quantity_of_dimension.hpp
@@ -0,0 +1,42 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_IS_QUANTITY_OF_DIMENSION_HPP
+#define BOOST_UNITS_IS_QUANTITY_OF_DIMENSION_HPP
+
+///
+/// \file
+/// \brief Check that a type is a quantity of the specified dimension.
+///
+
+#include <boost/mpl/bool.hpp>
+#include <boost/units/units_fwd.hpp>
+#include <boost/units/is_unit_of_dimension.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// Check that a type is a quantity of the specified dimension.
+template<class T,class Dim>
+struct is_quantity_of_dimension :
+ public mpl::false_
+{ };
+
+template<class Unit,class Y,class Dim>
+struct is_quantity_of_dimension< quantity< Unit,Y>,Dim > :
+ public is_unit_of_dimension<Unit, Dim>
+{ };
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_IS_QUANTITY_OF_DIMENSION_HPP
diff --git a/boost/units/is_quantity_of_system.hpp b/boost/units/is_quantity_of_system.hpp
new file mode 100644
index 0000000..18546eb
--- /dev/null
+++ b/boost/units/is_quantity_of_system.hpp
@@ -0,0 +1,42 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_IS_QUANTITY_OF_SYSTEM_HPP
+#define BOOST_UNITS_IS_QUANTITY_OF_SYSTEM_HPP
+
+///
+/// \file
+/// \brief Check that a type is a quantity in a specified system.
+///
+
+#include <boost/mpl/bool.hpp>
+#include <boost/units/units_fwd.hpp>
+#include <boost/units/is_unit_of_system.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// Check that a type is a quantity in a specified system.
+template<class T,class System>
+struct is_quantity_of_system :
+ public mpl::false_
+{ };
+
+template<class Unit,class Y,class System>
+struct is_quantity_of_system< quantity< Unit,Y>,System > :
+ public is_unit_of_system<Unit, System>
+{ };
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_IS_QUANTITY_OF_SYSTEM_HPP
diff --git a/boost/units/is_unit.hpp b/boost/units/is_unit.hpp
new file mode 100644
index 0000000..195c42f
--- /dev/null
+++ b/boost/units/is_unit.hpp
@@ -0,0 +1,41 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_IS_UNIT_HPP
+#define BOOST_UNITS_IS_UNIT_HPP
+
+///
+/// \file
+/// \brief Check that a type is a unit.
+///
+
+#include <boost/mpl/bool.hpp>
+#include <boost/units/units_fwd.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// Check that a type is a unit.
+template<class T>
+struct is_unit :
+ public mpl::false_
+{ };
+
+template<class Dim,class System>
+struct is_unit< unit<Dim,System> > :
+ public mpl::true_
+{ };
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_IS_UNIT_HPP
diff --git a/boost/units/is_unit_of_dimension.hpp b/boost/units/is_unit_of_dimension.hpp
new file mode 100644
index 0000000..4fc878b
--- /dev/null
+++ b/boost/units/is_unit_of_dimension.hpp
@@ -0,0 +1,46 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_IS_UNIT_OF_DIMENSION_HPP
+#define BOOST_UNITS_IS_UNIT_OF_DIMENSION_HPP
+
+///
+/// \file
+/// \brief Check that a type is a unit of the specified dimension.
+///
+
+#include <boost/mpl/bool.hpp>
+#include <boost/units/units_fwd.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// Check that a type is a unit of the specified dimension.
+template<class T,class Dim>
+struct is_unit_of_dimension :
+ public mpl::false_
+{ };
+
+template<class Dim,class System>
+struct is_unit_of_dimension< unit<Dim,System>,Dim > :
+ public mpl::true_
+{ };
+
+template<class Dim,class System>
+struct is_unit_of_dimension< absolute<unit<Dim,System> >,Dim > :
+ public mpl::true_
+{ };
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_IS_UNIT_OF_DIMENSION_HPP
diff --git a/boost/units/is_unit_of_system.hpp b/boost/units/is_unit_of_system.hpp
new file mode 100644
index 0000000..3c3eaa7
--- /dev/null
+++ b/boost/units/is_unit_of_system.hpp
@@ -0,0 +1,46 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_IS_UNIT_OF_SYSTEM_HPP
+#define BOOST_UNITS_IS_UNIT_OF_SYSTEM_HPP
+
+///
+/// \file
+/// \brief Check that a type is a unit in a specified system.
+///
+
+#include <boost/mpl/bool.hpp>
+#include <boost/units/units_fwd.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// Check that a type is a unit in a specified system.
+template<class T,class System>
+struct is_unit_of_system :
+ public mpl::false_
+{ };
+
+template<class Dim,class System>
+struct is_unit_of_system< unit<Dim,System>,System > :
+ public mpl::true_
+{ };
+
+template<class Dim,class System>
+struct is_unit_of_system< absolute<unit<Dim,System> >,System > :
+ public mpl::true_
+{ };
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_IS_UNIT_OF_SYSTEM_HPP
diff --git a/boost/units/lambda.hpp b/boost/units/lambda.hpp
new file mode 100644
index 0000000..9014cca
--- /dev/null
+++ b/boost/units/lambda.hpp
@@ -0,0 +1,593 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// $Id: lambda.hpp 27 2008-06-16 14:50:58Z maehne $
+
+#ifndef BOOST_UNITS_LAMBDA_HPP
+#define BOOST_UNITS_LAMBDA_HPP
+
+
+////////////////////////////////////////////////////////////////////////
+///
+/// \file lambda.hpp
+///
+/// \brief Definitions to ease the usage of Boost.Units' quantity,
+/// unit, and absolute types in functors created with the
+/// Boost.Lambda library.
+///
+/// \author Torsten Maehne
+/// \date 2008-06-16
+///
+/// Boost.Lambda's return type deduction system is extented to make
+/// use of Boost.Units' typeof_helper trait classes for Boost.Units'
+/// quantity, absolute, and unit template classes.
+///
+////////////////////////////////////////////////////////////////////////
+
+
+#include <boost/lambda/lambda.hpp>
+#include <boost/units/units_fwd.hpp>
+#include <boost/units/detail/dimensionless_unit.hpp>
+#include <boost/units/operators.hpp>
+
+namespace boost {
+
+namespace lambda {
+
+ /// Partial specialization of return type trait for action
+ /// unit<Dim, System> * Y.
+ template<typename System, typename Dim, typename Y>
+ struct plain_return_type_2<arithmetic_action<multiply_action>,
+ boost::units::unit<Dim, System>,
+ Y > {
+ typedef typename boost::units::multiply_typeof_helper<
+ boost::units::unit<Dim, System>, Y >::type type;
+ };
+
+} // namespace lambda
+
+namespace units {
+
+ template<typename System, typename Dim, typename Arg>
+ struct multiply_typeof_helper<boost::units::unit<Dim, System>, boost::lambda::lambda_functor<Arg> > {
+ typedef boost::lambda::lambda_functor<
+ boost::lambda::lambda_functor_base<
+ boost::lambda::arithmetic_action<boost::lambda::multiply_action>,
+ tuple<typename boost::lambda::const_copy_argument<const boost::units::unit<Dim, System> >::type, boost::lambda::lambda_functor<Arg> >
+ >
+ > type;
+ };
+
+ /// Disambiguating overload for action
+ /// unit<Dim, System> * lambda_functor<Arg>
+ /// based on \<boost/lambda/detail/operators.hpp\>.
+ template<typename System, typename Dim, typename Arg>
+ inline const typename multiply_typeof_helper<boost::units::unit<Dim, System>, boost::lambda::lambda_functor<Arg> >::type
+ operator*(const boost::units::unit<Dim, System>& a,
+ const boost::lambda::lambda_functor<Arg>& b) {
+ return typename multiply_typeof_helper<boost::units::unit<Dim, System>, boost::lambda::lambda_functor<Arg> >::type::inherited
+ (tuple<typename boost::lambda::const_copy_argument<const boost::units::unit<Dim, System> >::type,
+ boost::lambda::lambda_functor<Arg> >
+ (a, b));
+ }
+
+} // namespace units
+
+namespace lambda {
+
+ /// Partial specialization of return type trait for action
+ /// unit<Dim, System> / Y.
+ template<typename System, typename Dim, typename Y>
+ struct plain_return_type_2<arithmetic_action<divide_action>,
+ boost::units::unit<Dim, System>,
+ Y > {
+ typedef typename boost::units::divide_typeof_helper<
+ boost::units::unit<Dim, System>, Y >::type type;
+ };
+
+} // namespace lambda
+
+namespace units {
+
+ template<typename System, typename Dim, typename Arg>
+ struct divide_typeof_helper<boost::units::unit<Dim, System>, boost::lambda::lambda_functor<Arg> > {
+ typedef boost::lambda::lambda_functor<
+ boost::lambda::lambda_functor_base<
+ boost::lambda::arithmetic_action<boost::lambda::divide_action>,
+ tuple<typename boost::lambda::const_copy_argument<const boost::units::unit<Dim, System> >::type, boost::lambda::lambda_functor<Arg> >
+ >
+ > type;
+ };
+
+ /// Disambiguating overload for action
+ /// unit<Dim, System> / lambda_functor<Arg>
+ /// based on \<boost/lambda/detail/operators.hpp\>.
+ template<typename System, typename Dim, typename Arg>
+ inline const typename divide_typeof_helper<boost::units::unit<Dim, System>, boost::lambda::lambda_functor<Arg> >::type
+ operator/(const boost::units::unit<Dim, System>& a,
+ const boost::lambda::lambda_functor<Arg>& b) {
+ return typename divide_typeof_helper<boost::units::unit<Dim, System>, boost::lambda::lambda_functor<Arg> >::type::inherited
+ (tuple<typename boost::lambda::const_copy_argument<const boost::units::unit<Dim, System> >::type,
+ boost::lambda::lambda_functor<Arg> >
+ (a, b));
+ }
+
+} // namespace units
+
+namespace lambda {
+
+ /// Partial specialization of return type trait for action
+ /// Y * unit<Dim, System>.
+ template<typename System, typename Dim, typename Y>
+ struct plain_return_type_2<arithmetic_action<multiply_action>,
+ Y,
+ boost::units::unit<Dim, System> > {
+ typedef typename boost::units::multiply_typeof_helper<
+ Y, boost::units::unit<Dim, System> >::type type;
+ };
+
+} // namespace lambda
+
+namespace units {
+
+ template<typename System, typename Dim, typename Arg>
+ struct multiply_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::unit<Dim, System> > {
+ typedef boost::lambda::lambda_functor<
+ boost::lambda::lambda_functor_base<
+ boost::lambda::arithmetic_action<boost::lambda::multiply_action>,
+ tuple<boost::lambda::lambda_functor<Arg>, typename boost::lambda::const_copy_argument<const boost::units::unit<Dim, System> >::type>
+ >
+ > type;
+ };
+
+ /// Disambiguating overload for action
+ /// lambda_functor<Arg> * unit<Dim, System>
+ /// based on \<boost/lambda/detail/operators.hpp\>.
+ template<typename System, typename Dim, typename Arg>
+ inline const typename multiply_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::unit<Dim, System> >::type
+ operator*(const boost::lambda::lambda_functor<Arg>& a,
+ const boost::units::unit<Dim, System>& b) {
+ return typename multiply_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::unit<Dim, System> >::type::inherited
+ (tuple<boost::lambda::lambda_functor<Arg>,
+ typename boost::lambda::const_copy_argument<const boost::units::unit<Dim, System> >::type>
+ (a, b));
+ }
+
+} // namespace units
+
+namespace lambda {
+
+ /// Partial specialization of return type trait for action
+ /// Y / unit<Dim, System>.
+ template<typename System, typename Dim, typename Y>
+ struct plain_return_type_2<arithmetic_action<divide_action>,
+ Y,
+ boost::units::unit<Dim, System> > {
+ typedef typename boost::units::divide_typeof_helper<
+ Y, boost::units::unit<Dim, System> >::type type;
+ };
+
+} // namespace lambda
+
+namespace units {
+
+ template<typename System, typename Dim, typename Arg>
+ struct divide_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::unit<Dim, System> > {
+ typedef boost::lambda::lambda_functor<
+ boost::lambda::lambda_functor_base<
+ boost::lambda::arithmetic_action<boost::lambda::divide_action>,
+ tuple<boost::lambda::lambda_functor<Arg>, typename boost::lambda::const_copy_argument<const boost::units::unit<Dim, System> >::type>
+ >
+ > type;
+ };
+
+ /// Disambiguating overload for action
+ /// lambda_functor<Arg> / unit<Dim, System>
+ /// based on \<boost/lambda/detail/operators.hpp\>.
+ template<typename System, typename Dim, typename Arg>
+ inline const typename divide_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::unit<Dim, System> >::type
+ operator/(const boost::lambda::lambda_functor<Arg>& a,
+ const boost::units::unit<Dim, System>& b) {
+ return typename divide_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::unit<Dim, System> >::type::inherited
+ (tuple<boost::lambda::lambda_functor<Arg>,
+ typename boost::lambda::const_copy_argument<const boost::units::unit<Dim, System> >::type>
+ (a, b));
+ }
+
+} // namespace units
+
+namespace lambda {
+
+ /// Partial specialization of return type trait for action
+ /// quantity<Unit, X> * X.
+ template<typename Unit, typename X>
+ struct plain_return_type_2<arithmetic_action<multiply_action>,
+ boost::units::quantity<Unit, X>,
+ X> {
+ typedef typename boost::units::multiply_typeof_helper<
+ boost::units::quantity<Unit, X>, X>::type type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// X * quantity<Unit, X>.
+ template<typename Unit, typename X>
+ struct plain_return_type_2<arithmetic_action<multiply_action>,
+ X,
+ boost::units::quantity<Unit, X> > {
+ typedef typename boost::units::multiply_typeof_helper<
+ X, boost::units::quantity<Unit, X> >::type type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// quantity<Unit, X> / X.
+ template<typename Unit, typename X>
+ struct plain_return_type_2<arithmetic_action<divide_action>,
+ boost::units::quantity<Unit, X>,
+ X> {
+ typedef typename boost::units::divide_typeof_helper<
+ boost::units::quantity<Unit, X>, X>::type type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// X / quantity<Unit, X>.
+ template<typename Unit, typename X>
+ struct plain_return_type_2<arithmetic_action<divide_action>,
+ X,
+ boost::units::quantity<Unit, X> > {
+ typedef typename boost::units::divide_typeof_helper<
+ X, boost::units::quantity<Unit, X> >::type type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// unit<Dim1, System1> * quantity<Unit2, Y>.
+ template<typename System1, typename Dim1, typename Unit2, typename Y>
+ struct plain_return_type_2<arithmetic_action<multiply_action>,
+ boost::units::unit<Dim1, System1>,
+ boost::units::quantity<Unit2, Y> > {
+ typedef typename boost::units::multiply_typeof_helper<
+ boost::units::unit<Dim1, System1>,
+ boost::units::quantity<Unit2, Y> >::type type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// unit<Dim1, System1> / quantity<Unit2, Y>.
+ template<typename System1, typename Dim1, typename Unit2, typename Y>
+ struct plain_return_type_2<arithmetic_action<divide_action>,
+ boost::units::unit<Dim1, System1>,
+ boost::units::quantity<Unit2, Y> > {
+ typedef typename boost::units::divide_typeof_helper<
+ boost::units::unit<Dim1, System1>,
+ boost::units::quantity<Unit2, Y> >::type type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// quantity<Unit1, Y> * unit<Dim2, System2>.
+ template<typename Unit1, typename Y, typename System2, typename Dim2>
+ struct plain_return_type_2<arithmetic_action<multiply_action>,
+ boost::units::quantity<Unit1, Y>,
+ boost::units::unit<Dim2, System2> > {
+ typedef typename boost::units::multiply_typeof_helper<
+ boost::units::quantity<Unit1, Y>,
+ boost::units::unit<Dim2, System2> >::type type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// quantity<Unit1, Y> / unit<Dim2, System2>.
+ template<typename Unit1, typename Y, typename System2, typename Dim2>
+ struct plain_return_type_2<arithmetic_action<divide_action>,
+ boost::units::quantity<Unit1, Y>,
+ boost::units::unit<Dim2, System2> > {
+ typedef typename boost::units::divide_typeof_helper<
+ boost::units::quantity<Unit1, Y>,
+ boost::units::unit<Dim2, System2> >::type type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// +quantity<Unit, Y>.
+ template<typename Unit, typename Y>
+ struct plain_return_type_1<unary_arithmetic_action<plus_action>,
+ boost::units::quantity<Unit, Y> > {
+ typedef typename boost::units::unary_plus_typeof_helper<
+ boost::units::quantity<Unit, Y> >::type type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// -quantity<Unit, Y>.
+ template<typename Unit, typename Y>
+ struct plain_return_type_1<unary_arithmetic_action<minus_action>,
+ boost::units::quantity<Unit, Y> > {
+ typedef typename boost::units::unary_minus_typeof_helper<
+ boost::units::quantity<Unit, Y> >::type type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// quantity<Unit1, X> + quantity<Unit2, Y>.
+ template<typename Unit1, typename X, typename Unit2, typename Y>
+ struct plain_return_type_2<arithmetic_action<plus_action>,
+ boost::units::quantity<Unit1, X>,
+ boost::units::quantity<Unit2, Y> > {
+ typedef typename boost::units::add_typeof_helper<
+ boost::units::quantity<Unit1, X>,
+ boost::units::quantity<Unit2, Y> >::type type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// quantity<dimensionless, X> + Y.
+ template<typename System, typename X, typename Y>
+ struct plain_return_type_2<arithmetic_action<plus_action>,
+ boost::units::quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), X>,
+ Y> {
+ typedef typename boost::units::add_typeof_helper<
+ boost::units::quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), X>,
+ Y>::type type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// X + quantity<dimensionless, Y>.
+ template<typename System, typename X, typename Y>
+ struct plain_return_type_2<arithmetic_action<plus_action>,
+ X,
+ boost::units::quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y> > {
+ typedef typename boost::units::add_typeof_helper<
+ X,
+ boost::units::quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y> >::type type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// quantity<Unit1, X> - quantity<Unit2, Y>.
+ template<typename Unit1, typename X, typename Unit2, typename Y>
+ struct plain_return_type_2<arithmetic_action<minus_action>,
+ boost::units::quantity<Unit1, X>,
+ boost::units::quantity<Unit2, Y> > {
+ typedef typename boost::units::subtract_typeof_helper<
+ boost::units::quantity<Unit1, X>,
+ boost::units::quantity<Unit2, Y> >::type type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// quantity<dimensionless, X> - Y.
+ template<typename System, typename X, typename Y>
+ struct plain_return_type_2<arithmetic_action<minus_action>,
+ boost::units::quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), X>,
+ Y> {
+ typedef typename boost::units::subtract_typeof_helper<
+ boost::units::quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), X>,
+ Y>::type type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// X - quantity<dimensionless, Y>.
+ template<typename System, typename X, typename Y>
+ struct plain_return_type_2<arithmetic_action<minus_action>,
+ X,
+ boost::units::quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y> > {
+ typedef typename boost::units::subtract_typeof_helper<
+ X,
+ boost::units::quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y> >::type type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// quantity<Unit1, X> * quantity<Unit2, Y>.
+ template<typename Unit1, typename X, typename Unit2, typename Y>
+ struct plain_return_type_2<arithmetic_action<multiply_action>,
+ boost::units::quantity<Unit1, X>,
+ boost::units::quantity<Unit2, Y> > {
+ typedef typename boost::units::multiply_typeof_helper<
+ boost::units::quantity<Unit1, X>,
+ boost::units::quantity<Unit2, Y> >::type type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// quantity<Unit1, X> / quantity<Unit2, Y>.
+ template<typename Unit1, typename X, typename Unit2, typename Y>
+ struct plain_return_type_2<arithmetic_action<divide_action>,
+ boost::units::quantity<Unit1, X>,
+ boost::units::quantity<Unit2, Y> > {
+ typedef typename boost::units::divide_typeof_helper<
+ boost::units::quantity<Unit1, X>,
+ boost::units::quantity<Unit2, Y> >::type type;
+ };
+
+
+ ////////////////////////////////////////////////////////////////////////
+ // Partial specialization of Boost.Lambda's trait classes for all
+ // operators overloaded in <boost/units/unit.hpp>
+ ////////////////////////////////////////////////////////////////////////
+
+ /// Partial specialization of return type trait for action
+ /// +unit<Dim, System>.
+ template<typename Dim, typename System>
+ struct plain_return_type_1<unary_arithmetic_action<plus_action>,
+ boost::units::unit<Dim, System> > {
+ typedef typename boost::units::unary_plus_typeof_helper<
+ boost::units::unit<Dim, System> >::type type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// -unit<Dim, System>.
+ template<typename Dim, typename System>
+ struct plain_return_type_1<unary_arithmetic_action<minus_action>,
+ boost::units::unit<Dim, System> > {
+ typedef typename boost::units::unary_minus_typeof_helper<
+ boost::units::unit<Dim, System> >::type type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// unit<Dim1, System1> + unit<Dim2, System2>.
+ template<typename Dim1, typename Dim2, typename System1, typename System2>
+ struct plain_return_type_2<arithmetic_action<plus_action>,
+ boost::units::unit<Dim1, System1>,
+ boost::units::unit<Dim2, System2> > {
+ typedef typename boost::units::add_typeof_helper<
+ boost::units::unit<Dim1, System1>,
+ boost::units::unit<Dim2, System2> >::type type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// unit<Dim1, System1> - unit<Dim2, System2>.
+ template<typename Dim1, typename Dim2, typename System1, typename System2>
+ struct plain_return_type_2<arithmetic_action<minus_action>,
+ boost::units::unit<Dim1, System1>,
+ boost::units::unit<Dim2, System2> > {
+ typedef typename boost::units::subtract_typeof_helper<
+ boost::units::unit<Dim1, System1>,
+ boost::units::unit<Dim2, System2> >::type type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// unit<Dim1, System1> * unit<Dim2, System2>.
+ template<typename Dim1, typename Dim2, typename System1, typename System2>
+ struct plain_return_type_2<arithmetic_action<multiply_action>,
+ boost::units::unit<Dim1, System1>,
+ boost::units::unit<Dim2, System2> > {
+ typedef typename boost::units::multiply_typeof_helper<
+ boost::units::unit<Dim1, System1>,
+ boost::units::unit<Dim2, System2> >::type type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// unit<Dim1, System1> / unit<Dim2, System2>.
+ template<typename Dim1, typename Dim2, typename System1, typename System2>
+ struct plain_return_type_2<arithmetic_action<divide_action>,
+ boost::units::unit<Dim1, System1>,
+ boost::units::unit<Dim2, System2> > {
+ typedef typename boost::units::divide_typeof_helper<
+ boost::units::unit<Dim1, System1>,
+ boost::units::unit<Dim2, System2> >::type type;
+ };
+
+
+ ////////////////////////////////////////////////////////////////////////
+ // Partial specialization of Boost.Lambda's trait classes for all
+ // operators overloaded in <boost/units/absolute.hpp>
+ ////////////////////////////////////////////////////////////////////////
+
+
+ /// Partial specialization of return type trait for action
+ /// absolute<Y> + Y.
+ template<typename Y>
+ struct plain_return_type_2<arithmetic_action<plus_action>,
+ boost::units::absolute<Y>,
+ Y> {
+ typedef typename boost::units::absolute<Y> type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// Y + absolute<Y>.
+ template<typename Y>
+ struct plain_return_type_2<arithmetic_action<plus_action>,
+ Y,
+ boost::units::absolute<Y> > {
+ typedef typename boost::units::absolute<Y> type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// absolute<Y> - Y.
+ template<typename Y>
+ struct plain_return_type_2<arithmetic_action<minus_action>,
+ boost::units::absolute<Y>,
+ Y> {
+ typedef typename boost::units::absolute<Y> type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// absolute<Y> - absolute<Y>.
+ template<typename Y>
+ struct plain_return_type_2<arithmetic_action<minus_action>,
+ boost::units::absolute<Y>,
+ boost::units::absolute<Y> > {
+ typedef Y type;
+ };
+
+ /// Partial specialization of return type trait for action
+ /// T * absolute<unit<D, S> >.
+ template<typename D, typename S, typename T>
+ struct plain_return_type_2<arithmetic_action<multiply_action>,
+ T,
+ boost::units::absolute<boost::units::unit<D, S> > > {
+ typedef typename boost::units::quantity<
+ boost::units::absolute<boost::units::unit<D, S> >, T> type;
+ };
+
+} // namespace lambda
+
+namespace units {
+
+ template<typename System, typename Dim, typename Arg>
+ struct multiply_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::absolute<boost::units::unit<Dim, System> > > {
+ typedef boost::lambda::lambda_functor<
+ boost::lambda::lambda_functor_base<
+ boost::lambda::arithmetic_action<boost::lambda::multiply_action>,
+ tuple<boost::lambda::lambda_functor<Arg>,
+ typename boost::lambda::const_copy_argument<const boost::units::absolute<boost::units::unit<Dim, System> > >::type>
+ >
+ > type;
+ };
+
+ /// Disambiguating overload for action
+ /// lambda_functor<Arg> * absolute<unit<Dim, System> >
+ /// based on \<boost/lambda/detail/operators.hpp\>.
+ template<typename System, typename Dim, typename Arg>
+ inline const typename multiply_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::absolute<boost::units::unit<Dim, System> > >::type
+ operator*(const boost::lambda::lambda_functor<Arg>& a,
+ const boost::units::absolute<boost::units::unit<Dim, System> >& b) {
+ return typename multiply_typeof_helper<boost::lambda::lambda_functor<Arg>, boost::units::absolute<boost::units::unit<Dim, System> > >::type::inherited
+ (tuple<boost::lambda::lambda_functor<Arg>,
+ typename boost::lambda::const_copy_argument<const boost::units::absolute<boost::units::unit<Dim, System> > >::type>
+ (a, b));
+ }
+
+} // namespace units
+
+namespace lambda {
+
+ /// Partial specialization of return type trait for action
+ /// absolute<unit<D, S> > * T.
+ template<typename D, typename S, typename T>
+ struct plain_return_type_2<arithmetic_action<multiply_action>,
+ boost::units::absolute<boost::units::unit<D, S> >,
+ T> {
+ typedef typename boost::units::quantity<
+ boost::units::absolute<boost::units::unit<D, S> >, T> type;
+ };
+
+} // namespace lambda
+
+namespace units {
+
+ template<typename System, typename Dim, typename Arg>
+ struct multiply_typeof_helper<boost::units::absolute<boost::units::unit<Dim, System> >, boost::lambda::lambda_functor<Arg> > {
+ typedef boost::lambda::lambda_functor<
+ boost::lambda::lambda_functor_base<
+ boost::lambda::arithmetic_action<boost::lambda::multiply_action>,
+ tuple<typename boost::lambda::const_copy_argument<const boost::units::absolute<boost::units::unit<Dim, System> > >::type,
+ boost::lambda::lambda_functor<Arg> >
+ >
+ > type;
+ };
+
+ /// Disambiguating overload for action
+ /// absolute<unit<Dim, System> > * lambda_functor<Arg>
+ /// based on \<boost/lambda/detail/operators.hpp\>.
+ template<typename System, typename Dim, typename Arg>
+ inline const typename multiply_typeof_helper<boost::units::absolute<boost::units::unit<Dim, System> >, boost::lambda::lambda_functor<Arg> >::type
+ operator*(const boost::units::absolute<boost::units::unit<Dim, System> >& a,
+ const boost::lambda::lambda_functor<Arg>& b) {
+ return typename multiply_typeof_helper<boost::units::absolute<boost::units::unit<Dim, System> >, boost::lambda::lambda_functor<Arg> >::type::inherited
+ (tuple<typename boost::lambda::const_copy_argument<const boost::units::absolute<boost::units::unit<Dim, System> > >::type,
+ boost::lambda::lambda_functor<Arg> >
+ (a, b));
+ }
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_LAMBDA_HPP
diff --git a/boost/units/limits.hpp b/boost/units/limits.hpp
new file mode 100644
index 0000000..2c8a0bf
--- /dev/null
+++ b/boost/units/limits.hpp
@@ -0,0 +1,69 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_LIMITS_HPP
+#define BOOST_UNITS_LIMITS_HPP
+
+///
+/// \file
+/// \brief specialize std::numeric_limits for units.
+///
+
+#include <limits>
+
+#include <boost/units/units_fwd.hpp>
+
+namespace std {
+
+template<class Unit, class T>
+class numeric_limits< ::boost::units::quantity<Unit, T> >
+{
+ public:
+ typedef ::boost::units::quantity<Unit, T> quantity_type;
+ static const bool is_specialized = std::numeric_limits<T>::is_specialized;
+ static quantity_type (min)() { return(quantity_type::from_value((std::numeric_limits<T>::min)())); }
+ static quantity_type (max)() { return(quantity_type::from_value((std::numeric_limits<T>::max)())); }
+ static const int digits = std::numeric_limits<T>::digits;
+ static const int digits10 = std::numeric_limits<T>::digits10;
+ static const bool is_signed = std::numeric_limits<T>::is_signed;
+ static const bool is_integer = std::numeric_limits<T>::is_integer;
+ static const bool is_exact = std::numeric_limits<T>::is_exact;
+ static const int radix = std::numeric_limits<T>::radix;
+ static quantity_type epsilon() { return(quantity_type::from_value(std::numeric_limits<T>::epsilon())); }
+ static quantity_type round_error() { return(quantity_type::from_value(std::numeric_limits<T>::round_error())); }
+ static const int min_exponent = std::numeric_limits<T>::min_exponent;
+ static const int min_exponent10 = std::numeric_limits<T>::min_exponent10;
+ static const int max_exponent = std::numeric_limits<T>::max_exponent;
+ static const int max_exponent10 = std::numeric_limits<T>::max_exponent10;
+ static const bool has_infinity = std::numeric_limits<T>::has_infinity;
+ static const bool has_quiet_NaN = std::numeric_limits<T>::has_quiet_NaN;
+ static const bool has_signaling_NaN = std::numeric_limits<T>::has_signaling_NaN;
+ static const bool has_denorm_loss = std::numeric_limits<T>::has_denorm_loss;
+ static quantity_type infinity() { return(quantity_type::from_value(std::numeric_limits<T>::infinity())); }
+ static quantity_type quiet_NaN() { return(quantity_type::from_value(std::numeric_limits<T>::quiet_NaN())); }
+ static quantity_type signaling_NaN() { return(quantity_type::from_value(std::numeric_limits<T>::signaling_NaN())); }
+ static quantity_type denorm_min() { return(quantity_type::from_value(std::numeric_limits<T>::denorm_min())); }
+ static const bool is_iec559 = std::numeric_limits<T>::is_iec559;
+ static const bool is_bounded = std::numeric_limits<T>::is_bounded;
+ static const bool is_modulo = std::numeric_limits<T>::is_modulo;
+ static const bool traps = std::numeric_limits<T>::traps;
+ static const bool tinyness_before = std::numeric_limits<T>::tinyness_before;
+#if defined(_STLP_STATIC_CONST_INIT_BUG)
+ static const int has_denorm = std::numeric_limits<T>::has_denorm;
+ static const int round_style = std::numeric_limits<T>::round_style;
+#else
+ static const float_denorm_style has_denorm = std::numeric_limits<T>::has_denorm;
+ static const float_round_style round_style = std::numeric_limits<T>::round_style;
+#endif
+};
+
+}
+
+#endif // BOOST_UNITS_LIMITS_HPP
diff --git a/boost/units/make_scaled_unit.hpp b/boost/units/make_scaled_unit.hpp
new file mode 100644
index 0000000..d9740ff
--- /dev/null
+++ b/boost/units/make_scaled_unit.hpp
@@ -0,0 +1,60 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_MAKE_SCALED_UNIT_HPP_INCLUDED
+#define BOOST_UNITS_MAKE_SCALED_UNIT_HPP_INCLUDED
+
+#include <boost/units/units_fwd.hpp>
+#include <boost/units/heterogeneous_system.hpp>
+#include <boost/units/unit.hpp>
+
+namespace boost {
+namespace units {
+
+template<class Unit, class Scale>
+struct make_scaled_unit {
+ typedef typename make_scaled_unit<typename reduce_unit<Unit>::type, Scale>::type type;
+};
+
+template<class Dimension, class UnitList, class OldScale, class Scale>
+struct make_scaled_unit<unit<Dimension, heterogeneous_system<heterogeneous_system_impl<UnitList, Dimension, OldScale> > >, Scale> {
+ typedef unit<
+ Dimension,
+ heterogeneous_system<
+ heterogeneous_system_impl<
+ UnitList,
+ Dimension,
+ typename mpl::times<
+ OldScale,
+ list<scale_list_dim<Scale>, dimensionless_type>
+ >::type
+ >
+ >
+ > type;
+};
+
+template<class Dimension, class UnitList, class OldScale, long Base>
+struct make_scaled_unit<unit<Dimension, heterogeneous_system<heterogeneous_system_impl<UnitList, Dimension, OldScale> > >, scale<Base, static_rational<0> > > {
+ typedef unit<
+ Dimension,
+ heterogeneous_system<
+ heterogeneous_system_impl<
+ UnitList,
+ Dimension,
+ OldScale
+ >
+ >
+ > type;
+};
+
+}
+}
+
+#endif
diff --git a/boost/units/make_system.hpp b/boost/units/make_system.hpp
new file mode 100644
index 0000000..1918268
--- /dev/null
+++ b/boost/units/make_system.hpp
@@ -0,0 +1,145 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_MAKE_SYSTEM_HPP
+#define BOOST_UNITS_MAKE_SYSTEM_HPP
+
+/// \file
+/// \brief Metafunction returning a homogeneous system that can
+/// represent any combination of the base units.
+/// \details
+/// Metafunction make_system returning a homogeneous system that can
+/// represent any combination of the base units. There must
+/// be no way to represent any of the base units in terms
+/// of the others. make_system<foot_base_unit, meter_base_unit>::type
+/// is not allowed, for example.
+
+#include <boost/units/config.hpp>
+#include <boost/units/dimensionless_type.hpp>
+#include <boost/units/homogeneous_system.hpp>
+#include <boost/units/detail/dimension_list.hpp>
+#include <boost/units/detail/sort.hpp>
+
+namespace boost {
+
+namespace units {
+
+#ifdef BOOST_UNITS_DOXYGEN
+
+namespace detail {
+
+struct unspecified {};
+
+}
+
+/// Metafunction returning a homogeneous system that can
+/// represent any combination of the base units. There must
+/// be no way to represent any of the base units in terms
+/// of the others. make_system<foot_base_unit, meter_base_unit>::type
+/// is not allowed, for example.
+template<class BaseUnit0, class BaseUnit1, class BaseUnit2, ..., class BaseUnitN>
+struct make_system
+{
+ typedef homogeneous_system<detail::unspecified> type;
+};
+
+#else
+
+struct na {};
+
+template<
+ class U0 = na,
+ class U1 = na,
+ class U2 = na,
+ class U3 = na,
+ class U4 = na,
+ class U5 = na,
+ class U6 = na,
+ class U7 = na,
+ class U8 = na,
+ class U9 = na
+>
+struct make_system;
+
+template<>
+struct make_system<>
+{
+ typedef homogeneous_system<dimensionless_type> type;
+};
+
+// Codewarrior 9.2 doesn't like using the defaults. Need
+// to specify na explicitly.
+template<class T0>
+struct make_system<T0, na, na, na, na, na, na, na, na, na>
+{
+ typedef homogeneous_system<list<T0, dimensionless_type> > type;
+};
+
+template<class T0, class T1>
+struct make_system<T0, T1, na, na, na, na, na, na, na, na>
+{
+ typedef homogeneous_system<typename detail::insertion_sort<list<T0, list<T1, dimensionless_type> > >::type> type;
+};
+
+template<class T0, class T1, class T2>
+struct make_system<T0, T1, T2, na, na, na, na, na, na, na>
+{
+ typedef homogeneous_system<typename detail::insertion_sort<list<T0, list<T1, list<T2, dimensionless_type> > > >::type> type;
+};
+
+template<class T0, class T1, class T2, class T3>
+struct make_system<T0, T1, T2, T3, na, na, na, na, na, na>
+{
+ typedef homogeneous_system<typename detail::insertion_sort<list<T0, list<T1, list<T2, list<T3, dimensionless_type> > > > >::type> type;
+};
+
+template<class T0, class T1, class T2, class T3, class T4>
+struct make_system<T0, T1, T2, T3, T4, na, na, na, na, na>
+{
+ typedef homogeneous_system<typename detail::insertion_sort<list<T0, list<T1, list<T2, list<T3, list<T4, dimensionless_type> > > > > >::type> type;
+};
+
+template<class T0, class T1, class T2, class T3, class T4, class T5>
+struct make_system<T0, T1, T2, T3, T4, T5, na, na, na, na>
+{
+ typedef homogeneous_system<typename detail::insertion_sort<list<T0, list<T1, list<T2, list<T3, list<T4, list<T5, dimensionless_type> > > > > > >::type> type;
+};
+
+template<class T0, class T1, class T2, class T3, class T4, class T5, class T6>
+struct make_system<T0, T1, T2, T3, T4, T5, T6, na, na, na>
+{
+ typedef homogeneous_system<typename detail::insertion_sort<list<T0, list<T1, list<T2, list<T3, list<T4, list<T5, list<T6, dimensionless_type> > > > > > > >::type> type;
+};
+
+template<class T0, class T1, class T2, class T3, class T4, class T5, class T6, class T7>
+struct make_system<T0, T1, T2, T3, T4, T5, T6, T7, na, na>
+{
+ typedef homogeneous_system<typename detail::insertion_sort<list<T0, list<T1, list<T2, list<T3, list<T4, list<T5, list<T6, list<T7, dimensionless_type> > > > > > > > >::type> type;
+};
+
+template<class T0, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
+struct make_system<T0, T1, T2, T3, T4, T5, T6, T7, T8, na>
+{
+ typedef homogeneous_system<typename detail::insertion_sort<list<T0, list<T1, list<T2, list<T3, list<T4, list<T5, list<T6, list<T7, list<T8, dimensionless_type> > > > > > > > > >::type> type;
+};
+
+template<class T0, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
+struct make_system
+{
+ typedef homogeneous_system<typename detail::insertion_sort<list<T0, list<T1, list<T2, list<T3, list<T4, list<T5, list<T6, list<T7, list<T8, list<T9, dimensionless_type> > > > > > > > > > >::type> type;
+};
+
+#endif
+
+} // namespace units
+
+} // namespace boost
+
+#endif
diff --git a/boost/units/operators.hpp b/boost/units/operators.hpp
new file mode 100644
index 0000000..19b8aac
--- /dev/null
+++ b/boost/units/operators.hpp
@@ -0,0 +1,164 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_OPERATORS_HPP
+#define BOOST_UNITS_OPERATORS_HPP
+
+
+///
+/// \file
+/// \brief Compile time operators and typeof helper classes.
+/// \details
+/// These operators declare the compile-time operators needed to support dimensional
+/// analysis algebra. They require the use of Boost.Typeof, emulation or native.
+/// Typeof helper classes define result type for heterogeneous operators on value types.
+/// These must be defined through specialization for powers and roots.
+///
+
+#include <boost/static_assert.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+#include <boost/units/config.hpp>
+
+namespace boost {
+namespace units {
+
+#if BOOST_UNITS_HAS_TYPEOF
+
+#ifndef BOOST_UNITS_DOXYGEN
+
+// to avoid need for default constructor and eliminate divide by zero errors.
+namespace typeof_ {
+
+/// INTERNAL ONLY
+template<class T> T make();
+
+} // namespace typeof_
+
+#endif
+
+#if (BOOST_UNITS_HAS_BOOST_TYPEOF)
+
+template<typename X> struct unary_plus_typeof_helper
+{
+ BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested, (+typeof_::make<X>()))
+ typedef typename nested::type type;
+};
+
+template<typename X> struct unary_minus_typeof_helper
+{
+ BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested, (-typeof_::make<X>()))
+ typedef typename nested::type type;
+};
+
+template<typename X,typename Y> struct add_typeof_helper
+{
+ BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested, (typeof_::make<X>()+typeof_::make<Y>()))
+ typedef typename nested::type type;
+};
+
+template<typename X,typename Y> struct subtract_typeof_helper
+{
+ BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested, (typeof_::make<X>()-typeof_::make<Y>()))
+ typedef typename nested::type type;
+};
+
+template<typename X,typename Y> struct multiply_typeof_helper
+{
+ BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested, (typeof_::make<X>()*typeof_::make<Y>()))
+ typedef typename nested::type type;
+};
+
+template<typename X,typename Y> struct divide_typeof_helper
+{
+ BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested, (typeof_::make<X>()/typeof_::make<Y>()))
+ typedef typename nested::type type;
+};
+
+#elif (BOOST_UNITS_HAS_MWERKS_TYPEOF)
+
+template<typename X> struct unary_plus_typeof_helper { typedef __typeof__((+typeof_::make<X>())) type; };
+template<typename X> struct unary_minus_typeof_helper { typedef __typeof__((-typeof_::make<X>())) type; };
+
+template<typename X,typename Y> struct add_typeof_helper { typedef __typeof__((typeof_::make<X>()+typeof_::make<Y>())) type; };
+template<typename X,typename Y> struct subtract_typeof_helper { typedef __typeof__((typeof_::make<X>()-typeof_::make<Y>())) type; };
+template<typename X,typename Y> struct multiply_typeof_helper { typedef __typeof__((typeof_::make<X>()*typeof_::make<Y>())) type; };
+template<typename X,typename Y> struct divide_typeof_helper { typedef __typeof__((typeof_::make<X>()/typeof_::make<Y>())) type; };
+
+#elif (BOOST_UNITS_HAS_GNU_TYPEOF) || defined(BOOST_UNITS_DOXYGEN)
+
+template<typename X> struct unary_plus_typeof_helper { typedef typeof((+typeof_::make<X>())) type; };
+template<typename X> struct unary_minus_typeof_helper { typedef typeof((-typeof_::make<X>())) type; };
+
+template<typename X,typename Y> struct add_typeof_helper { typedef typeof((typeof_::make<X>()+typeof_::make<Y>())) type; };
+template<typename X,typename Y> struct subtract_typeof_helper { typedef typeof((typeof_::make<X>()-typeof_::make<Y>())) type; };
+template<typename X,typename Y> struct multiply_typeof_helper { typedef typeof((typeof_::make<X>()*typeof_::make<Y>())) type; };
+template<typename X,typename Y> struct divide_typeof_helper { typedef typeof((typeof_::make<X>()/typeof_::make<Y>())) type; };
+
+#endif
+
+#else // BOOST_UNITS_HAS_TYPEOF
+
+template<typename X> struct unary_plus_typeof_helper { typedef X type; };
+template<typename X> struct unary_minus_typeof_helper { typedef X type; };
+
+template<typename X,typename Y> struct add_typeof_helper { BOOST_STATIC_ASSERT((is_same<X,Y>::value == true)); typedef X type; };
+template<typename X,typename Y> struct subtract_typeof_helper { BOOST_STATIC_ASSERT((is_same<X,Y>::value == true)); typedef X type; };
+template<typename X,typename Y> struct multiply_typeof_helper { BOOST_STATIC_ASSERT((is_same<X,Y>::value == true)); typedef X type; };
+template<typename X,typename Y> struct divide_typeof_helper { BOOST_STATIC_ASSERT((is_same<X,Y>::value == true)); typedef X type; };
+
+#endif // BOOST_UNITS_HAS_TYPEOF
+
+template<typename X,typename Y> struct power_typeof_helper;
+template<typename X,typename Y> struct root_typeof_helper;
+
+#ifdef BOOST_UNITS_DOXYGEN
+
+/// A helper used by @c pow to raise
+/// a runtime object to a compile time
+/// known exponent. This template is intended to
+/// be specialized. All specializations must
+/// conform to the interface shown here.
+/// @c Exponent will be either the exponent
+/// passed to @c pow or @c static_rational<N>
+/// for and integer argument, N.
+template<typename BaseType, typename Exponent>
+struct power_typeof_helper
+{
+ /// specifies the result type
+ typedef detail::unspecified type;
+ /// Carries out the runtime calculation.
+ static type value(const BaseType& base);
+};
+
+/// A helper used by @c root to take a root
+/// of a runtime object using a compile time
+/// known index. This template is intended to
+/// be specialized. All specializations must
+/// conform to the interface shown here.
+/// @c Index will be either the type
+/// passed to @c pow or @c static_rational<N>
+/// for and integer argument, N.
+template<typename Radicand, typename Index>
+struct root_typeof_helper
+{
+ /// specifies the result type
+ typedef detail::unspecified type;
+ /// Carries out the runtime calculation.
+ static type value(const Radicand& base);
+};
+
+#endif
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_OPERATORS_HPP
diff --git a/boost/units/physical_dimensions.hpp b/boost/units/physical_dimensions.hpp
new file mode 100644
index 0000000..4137e1e
--- /dev/null
+++ b/boost/units/physical_dimensions.hpp
@@ -0,0 +1,90 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2010 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_PHYSICAL_UNITS_HPP
+#define BOOST_UNITS_PHYSICAL_UNITS_HPP
+
+///
+/// \file
+/// \brief Physical dimensions according to the SI system.
+/// \details This header includes all physical dimension headers for both base
+/// and derived dimensions.
+///
+
+// Include all of the physical_dimension headers.
+
+// SI seven fundamental dimensions.
+#include <boost/units/physical_dimensions/amount.hpp>
+#include <boost/units/physical_dimensions/current.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/luminous_intensity.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/temperature.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+
+// Base dimensions are extended to include plane and solid angle for convenience.
+#include <boost/units/physical_dimensions/plane_angle.hpp>
+#include <boost/units/physical_dimensions/solid_angle.hpp>
+
+// Derived dimensions.
+#include <boost/units/physical_dimensions/absorbed_dose.hpp>
+#include <boost/units/physical_dimensions/acceleration.hpp>
+#include <boost/units/physical_dimensions/action.hpp>
+#include <boost/units/physical_dimensions/activity.hpp>
+#include <boost/units/physical_dimensions/angular_acceleration.hpp>
+#include <boost/units/physical_dimensions/angular_momentum.hpp>
+#include <boost/units/physical_dimensions/angular_velocity.hpp>
+#include <boost/units/physical_dimensions/area.hpp>
+#include <boost/units/physical_dimensions/capacitance.hpp>
+#include <boost/units/physical_dimensions/conductance.hpp>
+#include <boost/units/physical_dimensions/conductivity.hpp>
+#include <boost/units/physical_dimensions/dose_equivalent.hpp>
+#include <boost/units/physical_dimensions/dynamic_viscosity.hpp>
+#include <boost/units/physical_dimensions/electric_charge.hpp>
+#include <boost/units/physical_dimensions/electric_potential.hpp>
+#include <boost/units/physical_dimensions/energy.hpp>
+#include <boost/units/physical_dimensions/energy_density.hpp>
+#include <boost/units/physical_dimensions/force.hpp>
+#include <boost/units/physical_dimensions/frequency.hpp>
+#include <boost/units/physical_dimensions/heat_capacity.hpp>
+#include <boost/units/physical_dimensions/illuminance.hpp>
+#include <boost/units/physical_dimensions/impedance.hpp>
+#include <boost/units/physical_dimensions/inductance.hpp>
+#include <boost/units/physical_dimensions/kinematic_viscosity.hpp>
+#include <boost/units/physical_dimensions/luminance.hpp>
+#include <boost/units/physical_dimensions/luminous_flux.hpp>
+#include <boost/units/physical_dimensions/magnetic_field_intensity.hpp>
+#include <boost/units/physical_dimensions/magnetic_flux.hpp>
+#include <boost/units/physical_dimensions/magnetic_flux_density.hpp>
+#include <boost/units/physical_dimensions/mass_density.hpp>
+#include <boost/units/physical_dimensions/molar_energy.hpp>
+#include <boost/units/physical_dimensions/molar_heat_capacity.hpp>
+#include <boost/units/physical_dimensions/moment_of_inertia.hpp>
+#include <boost/units/physical_dimensions/momentum.hpp>
+#include <boost/units/physical_dimensions/permeability.hpp>
+#include <boost/units/physical_dimensions/permittivity.hpp>
+#include <boost/units/physical_dimensions/power.hpp>
+#include <boost/units/physical_dimensions/pressure.hpp>
+#include <boost/units/physical_dimensions/reluctance.hpp>
+#include <boost/units/physical_dimensions/resistance.hpp>
+#include <boost/units/physical_dimensions/resistivity.hpp>
+#include <boost/units/physical_dimensions/specific_energy.hpp>
+#include <boost/units/physical_dimensions/specific_heat_capacity.hpp>
+#include <boost/units/physical_dimensions/specific_volume.hpp>
+#include <boost/units/physical_dimensions/stress.hpp>
+#include <boost/units/physical_dimensions/surface_density.hpp>
+#include <boost/units/physical_dimensions/surface_tension.hpp>
+#include <boost/units/physical_dimensions/thermal_conductivity.hpp>
+#include <boost/units/physical_dimensions/torque.hpp>
+#include <boost/units/physical_dimensions/velocity.hpp>
+#include <boost/units/physical_dimensions/volume.hpp>
+#include <boost/units/physical_dimensions/wavenumber.hpp>
+
+#endif // BOOST_UNITS_PHYSICAL_UNITS_HPP
diff --git a/boost/units/physical_dimensions/absorbed_dose.hpp b/boost/units/physical_dimensions/absorbed_dose.hpp
new file mode 100644
index 0000000..c62ed09
--- /dev/null
+++ b/boost/units/physical_dimensions/absorbed_dose.hpp
@@ -0,0 +1,30 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_ABSORBED_DOSE_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_ABSORBED_DOSE_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for absorbed dose : L^2 T^-2
+typedef derived_dimension<length_base_dimension,2,
+ time_base_dimension,-2>::type absorbed_dose_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_ABSORBED_DOSE_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/acceleration.hpp b/boost/units/physical_dimensions/acceleration.hpp
new file mode 100644
index 0000000..8f25c86
--- /dev/null
+++ b/boost/units/physical_dimensions/acceleration.hpp
@@ -0,0 +1,30 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_ACCELERATION_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_ACCELERATION_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for acceleration : L T^-2
+typedef derived_dimension<length_base_dimension,1,
+ time_base_dimension,-2>::type acceleration_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_ACCELERATION_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/action.hpp b/boost/units/physical_dimensions/action.hpp
new file mode 100644
index 0000000..cf38d32
--- /dev/null
+++ b/boost/units/physical_dimensions/action.hpp
@@ -0,0 +1,32 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_ACTION_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_ACTION_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for action : L^2 M T^-1
+typedef derived_dimension<length_base_dimension,2,
+ mass_base_dimension,1,
+ time_base_dimension,-1>::type action_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_ACTION_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/activity.hpp b/boost/units/physical_dimensions/activity.hpp
new file mode 100644
index 0000000..035cd44
--- /dev/null
+++ b/boost/units/physical_dimensions/activity.hpp
@@ -0,0 +1,28 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_ACTIVITY_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_ACTIVITY_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for activity : T^-1
+typedef derived_dimension<time_base_dimension,-1>::type activity_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_ACTIVITY_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/amount.hpp b/boost/units/physical_dimensions/amount.hpp
new file mode 100644
index 0000000..6d9d4b3
--- /dev/null
+++ b/boost/units/physical_dimensions/amount.hpp
@@ -0,0 +1,49 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_AMOUNT_BASE_DIMENSION_HPP
+#define BOOST_UNITS_AMOUNT_BASE_DIMENSION_HPP
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_dimension.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// base dimension of amount
+struct amount_base_dimension :
+ boost::units::base_dimension<amount_base_dimension,-4>
+{ };
+
+} // namespace units
+
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::amount_base_dimension)
+
+#endif
+
+namespace boost {
+
+namespace units {
+
+/// dimension of amount of substance (N)
+typedef amount_base_dimension::dimension_type amount_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_AMOUNT_BASE_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/angular_acceleration.hpp b/boost/units/physical_dimensions/angular_acceleration.hpp
new file mode 100644
index 0000000..79a3a14
--- /dev/null
+++ b/boost/units/physical_dimensions/angular_acceleration.hpp
@@ -0,0 +1,30 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_ANGULAR_ACCELERATION_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_ANGULAR_ACCELERATION_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/plane_angle.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for angular acceleration : T^-2 QP
+typedef derived_dimension<time_base_dimension,-2,
+ plane_angle_base_dimension,1>::type angular_acceleration_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_ANGULAR_ACCELERATION_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/angular_momentum.hpp b/boost/units/physical_dimensions/angular_momentum.hpp
new file mode 100644
index 0000000..0a86f88
--- /dev/null
+++ b/boost/units/physical_dimensions/angular_momentum.hpp
@@ -0,0 +1,34 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_ANGULAR_MOMENTUM_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_ANGULAR_MOMENTUM_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+#include <boost/units/physical_dimensions/plane_angle.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for angular momentum : L^2 M T^-1 QP^-1
+typedef derived_dimension<length_base_dimension,2,
+ mass_base_dimension,1,
+ time_base_dimension,-1,
+ plane_angle_base_dimension,-1>::type angular_momentum_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_ANGULAR_MOMENTUM_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/angular_velocity.hpp b/boost/units/physical_dimensions/angular_velocity.hpp
new file mode 100644
index 0000000..5d7ea87
--- /dev/null
+++ b/boost/units/physical_dimensions/angular_velocity.hpp
@@ -0,0 +1,30 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_ANGULAR_VELOCITY_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_ANGULAR_VELOCITY_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/plane_angle.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for angular velocity : T^-1 QP
+typedef derived_dimension<time_base_dimension,-1,
+ plane_angle_base_dimension,1>::type angular_velocity_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_ANGULAR_VELOCITY_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/area.hpp b/boost/units/physical_dimensions/area.hpp
new file mode 100644
index 0000000..0d8cb09
--- /dev/null
+++ b/boost/units/physical_dimensions/area.hpp
@@ -0,0 +1,28 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_AREA_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_AREA_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for area : L^2
+typedef derived_dimension<length_base_dimension,2>::type area_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_AREA_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/capacitance.hpp b/boost/units/physical_dimensions/capacitance.hpp
new file mode 100644
index 0000000..e7019a7
--- /dev/null
+++ b/boost/units/physical_dimensions/capacitance.hpp
@@ -0,0 +1,34 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_CAPACITANCE_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_CAPACITANCE_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+#include <boost/units/physical_dimensions/current.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for capacitance : L^-2 M^-1 T^4 I^2
+typedef derived_dimension<length_base_dimension,-2,
+ mass_base_dimension,-1,
+ time_base_dimension,4,
+ current_base_dimension,2>::type capacitance_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_CAPACITANCE_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/conductance.hpp b/boost/units/physical_dimensions/conductance.hpp
new file mode 100644
index 0000000..8405f92
--- /dev/null
+++ b/boost/units/physical_dimensions/conductance.hpp
@@ -0,0 +1,34 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_CONDUCTANCE_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_CONDUCTANCE_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+#include <boost/units/physical_dimensions/current.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for conductance : L^-2 M^-1 T^3 I^2
+typedef derived_dimension<length_base_dimension,-2,
+ mass_base_dimension,-1,
+ time_base_dimension,3,
+ current_base_dimension,2>::type conductance_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_CONDUCTANCE_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/conductivity.hpp b/boost/units/physical_dimensions/conductivity.hpp
new file mode 100644
index 0000000..d255915
--- /dev/null
+++ b/boost/units/physical_dimensions/conductivity.hpp
@@ -0,0 +1,34 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_CONDUCTIVITY_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_CONDUCTIVITY_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+#include <boost/units/physical_dimensions/current.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for conductivity : L^-3 M^-1 T^3 I^2
+typedef derived_dimension<length_base_dimension,-3,
+ mass_base_dimension,-1,
+ time_base_dimension,3,
+ current_base_dimension,2>::type conductivity_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_CONDUCTIVITY_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/current.hpp b/boost/units/physical_dimensions/current.hpp
new file mode 100644
index 0000000..6fa0e89
--- /dev/null
+++ b/boost/units/physical_dimensions/current.hpp
@@ -0,0 +1,49 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_CURRENT_BASE_DIMENSION_HPP
+#define BOOST_UNITS_CURRENT_BASE_DIMENSION_HPP
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_dimension.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// base dimension of current
+struct current_base_dimension :
+ boost::units::base_dimension<current_base_dimension,-6>
+{ };
+
+} // namespace units
+
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::current_base_dimension)
+
+#endif
+
+namespace boost {
+
+namespace units {
+
+/// dimension of electric current (I)
+typedef current_base_dimension::dimension_type current_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_CURRENT_BASE_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/dose_equivalent.hpp b/boost/units/physical_dimensions/dose_equivalent.hpp
new file mode 100644
index 0000000..ae13d2f
--- /dev/null
+++ b/boost/units/physical_dimensions/dose_equivalent.hpp
@@ -0,0 +1,30 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_DOSE_EQUIVALENT_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_DOSE_EQUIVALENT_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for dose equivalent : L^2 T^-2
+typedef derived_dimension<length_base_dimension,2,
+ time_base_dimension,-2>::type dose_equivalent_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_DOSE_EQUIVALENT_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/dynamic_viscosity.hpp b/boost/units/physical_dimensions/dynamic_viscosity.hpp
new file mode 100644
index 0000000..029f1fa
--- /dev/null
+++ b/boost/units/physical_dimensions/dynamic_viscosity.hpp
@@ -0,0 +1,32 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_DYNAMIC_VISCOSITY_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_DYNAMIC_VISCOSITY_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for dynamic viscosity : M L^-1 T^-1
+typedef derived_dimension<mass_base_dimension,1,
+ length_base_dimension,-1,
+ time_base_dimension,-1>::type dynamic_viscosity_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_DYNAMIC_VISCOSITY_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/electric_charge.hpp b/boost/units/physical_dimensions/electric_charge.hpp
new file mode 100644
index 0000000..3683646
--- /dev/null
+++ b/boost/units/physical_dimensions/electric_charge.hpp
@@ -0,0 +1,30 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_ELECTRIC_CHARGE_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_ELECTRIC_CHARGE_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+#include <boost/units/physical_dimensions/current.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for electric charge : T^1 I^1
+typedef derived_dimension<time_base_dimension,1,
+ current_base_dimension,1>::type electric_charge_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_ELECTRIC_CHARGE_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/electric_potential.hpp b/boost/units/physical_dimensions/electric_potential.hpp
new file mode 100644
index 0000000..1ef028c
--- /dev/null
+++ b/boost/units/physical_dimensions/electric_potential.hpp
@@ -0,0 +1,34 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_ELECTRIC_POTENTIAL_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_ELECTRIC_POTENTIAL_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+#include <boost/units/physical_dimensions/current.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for electric potential : L^2 M T^-3 I^-1
+typedef derived_dimension<length_base_dimension,2,
+ mass_base_dimension,1,
+ time_base_dimension,-3,
+ current_base_dimension,-1>::type electric_potential_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_ELECTRIC_POTENTIAL_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/energy.hpp b/boost/units/physical_dimensions/energy.hpp
new file mode 100644
index 0000000..bf0dbe3
--- /dev/null
+++ b/boost/units/physical_dimensions/energy.hpp
@@ -0,0 +1,32 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_ENERGY_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_ENERGY_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for energy : L^2 M T^-2
+typedef derived_dimension<length_base_dimension,2,
+ mass_base_dimension,1,
+ time_base_dimension,-2>::type energy_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_ENERGY_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/energy_density.hpp b/boost/units/physical_dimensions/energy_density.hpp
new file mode 100644
index 0000000..d30e1e1
--- /dev/null
+++ b/boost/units/physical_dimensions/energy_density.hpp
@@ -0,0 +1,32 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_ENERGY_DENSITY_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_ENERGY_DENSITY_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for energy density : L^-1 M^1 T^-2
+typedef derived_dimension<length_base_dimension,-1,
+ mass_base_dimension,1,
+ time_base_dimension,-2>::type energy_density_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_ENERGY_DENSITY_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/force.hpp b/boost/units/physical_dimensions/force.hpp
new file mode 100644
index 0000000..a1ed955
--- /dev/null
+++ b/boost/units/physical_dimensions/force.hpp
@@ -0,0 +1,32 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_FORCE_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_FORCE_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for force : L M T^-2
+typedef derived_dimension<length_base_dimension,1,
+ mass_base_dimension,1,
+ time_base_dimension,-2>::type force_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_FORCE_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/frequency.hpp b/boost/units/physical_dimensions/frequency.hpp
new file mode 100644
index 0000000..e2af7ee
--- /dev/null
+++ b/boost/units/physical_dimensions/frequency.hpp
@@ -0,0 +1,28 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_FREQUENCY_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_FREQUENCY_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for frequency : T^-1
+typedef derived_dimension<time_base_dimension,-1>::type frequency_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_FREQUENCY_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/heat_capacity.hpp b/boost/units/physical_dimensions/heat_capacity.hpp
new file mode 100644
index 0000000..3cbfa57
--- /dev/null
+++ b/boost/units/physical_dimensions/heat_capacity.hpp
@@ -0,0 +1,34 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_HEAT_CAPACITY_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_HEAT_CAPACITY_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+#include <boost/units/physical_dimensions/temperature.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for heat capacity : L^2 M T^-2 Theta^-1
+typedef derived_dimension<length_base_dimension,2,
+ mass_base_dimension,1,
+ time_base_dimension,-2,
+ temperature_base_dimension,-1>::type heat_capacity_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_HEAT_CAPACITY_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/illuminance.hpp b/boost/units/physical_dimensions/illuminance.hpp
new file mode 100644
index 0000000..a24daf4
--- /dev/null
+++ b/boost/units/physical_dimensions/illuminance.hpp
@@ -0,0 +1,32 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_ILLUMINANCE_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_ILLUMINANCE_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/luminous_intensity.hpp>
+#include <boost/units/physical_dimensions/solid_angle.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for illuminance : L^-2 I QS
+typedef derived_dimension<length_base_dimension,-2,
+ luminous_intensity_base_dimension,1,
+ solid_angle_base_dimension,1>::type illuminance_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_ILLUMINANCE_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/impedance.hpp b/boost/units/physical_dimensions/impedance.hpp
new file mode 100644
index 0000000..177fc60
--- /dev/null
+++ b/boost/units/physical_dimensions/impedance.hpp
@@ -0,0 +1,34 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_IMPEDANCE_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_IMPEDANCE_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+#include <boost/units/physical_dimensions/current.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for impedance : L^2 M T^-3 I^-2
+typedef derived_dimension<length_base_dimension,2,
+ mass_base_dimension,1,
+ time_base_dimension,-3,
+ current_base_dimension,-2>::type impedance_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_IMPEDANCE_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/inductance.hpp b/boost/units/physical_dimensions/inductance.hpp
new file mode 100644
index 0000000..1506364
--- /dev/null
+++ b/boost/units/physical_dimensions/inductance.hpp
@@ -0,0 +1,34 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_INDUCTANCE_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_INDUCTANCE_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+#include <boost/units/physical_dimensions/current.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for inductance : L^2 M T^-2 I^-2
+typedef derived_dimension<length_base_dimension,2,
+ mass_base_dimension,1,
+ time_base_dimension,-2,
+ current_base_dimension,-2>::type inductance_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_INDUCTANCE_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/kinematic_viscosity.hpp b/boost/units/physical_dimensions/kinematic_viscosity.hpp
new file mode 100644
index 0000000..e5c5261
--- /dev/null
+++ b/boost/units/physical_dimensions/kinematic_viscosity.hpp
@@ -0,0 +1,30 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_KINEMATIC_VISCOSITY_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_KINEMATIC_VISCOSITY_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for kinematic viscosity : L^2 T^-1
+typedef derived_dimension<length_base_dimension,2,
+ time_base_dimension,-1>::type kinematic_viscosity_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_KINEMATIC_VISCOSITY_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/length.hpp b/boost/units/physical_dimensions/length.hpp
new file mode 100644
index 0000000..22bbec4
--- /dev/null
+++ b/boost/units/physical_dimensions/length.hpp
@@ -0,0 +1,49 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_LENGTH_BASE_DIMENSION_HPP
+#define BOOST_UNITS_LENGTH_BASE_DIMENSION_HPP
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_dimension.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// base dimension of length
+struct length_base_dimension :
+ boost::units::base_dimension<length_base_dimension, -9>
+{ };
+
+} // namespace units
+
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::length_base_dimension)
+
+#endif
+
+namespace boost {
+
+namespace units {
+
+/// dimension of length (L)
+typedef length_base_dimension::dimension_type length_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_LENGTH_BASE_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/luminance.hpp b/boost/units/physical_dimensions/luminance.hpp
new file mode 100644
index 0000000..f2e6f24
--- /dev/null
+++ b/boost/units/physical_dimensions/luminance.hpp
@@ -0,0 +1,30 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_LUMINANCE_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_LUMINANCE_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/luminous_intensity.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for luminance : L^-2 I
+typedef derived_dimension<length_base_dimension,-2,
+ luminous_intensity_base_dimension,1>::type luminance_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_LUMINANCE_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/luminous_flux.hpp b/boost/units/physical_dimensions/luminous_flux.hpp
new file mode 100644
index 0000000..4c725ef
--- /dev/null
+++ b/boost/units/physical_dimensions/luminous_flux.hpp
@@ -0,0 +1,30 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_LUMINOUS_FLUX_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_LUMINOUS_FLUX_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/luminous_intensity.hpp>
+#include <boost/units/physical_dimensions/solid_angle.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for luminous flux : I QS
+typedef derived_dimension<luminous_intensity_base_dimension,1,
+ solid_angle_base_dimension,1>::type luminous_flux_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_LUMINOUS_FLUX_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/luminous_intensity.hpp b/boost/units/physical_dimensions/luminous_intensity.hpp
new file mode 100644
index 0000000..1da041d
--- /dev/null
+++ b/boost/units/physical_dimensions/luminous_intensity.hpp
@@ -0,0 +1,49 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_LUMINOUS_INTENSITY_BASE_DIMENSION_HPP
+#define BOOST_UNITS_LUMINOUS_INTENSITY_BASE_DIMENSION_HPP
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_dimension.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// base dimension of luminous intensity
+struct luminous_intensity_base_dimension :
+ boost::units::base_dimension<luminous_intensity_base_dimension,-3>
+{ };
+
+} // namespace units
+
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::luminous_intensity_base_dimension)
+
+#endif
+
+namespace boost {
+
+namespace units {
+
+/// dimension of luminous intensity (J)
+typedef luminous_intensity_base_dimension::dimension_type luminous_intensity_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_LUMINOUS_INTENSITY_BASE_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/magnetic_field_intensity.hpp b/boost/units/physical_dimensions/magnetic_field_intensity.hpp
new file mode 100644
index 0000000..665e5bc
--- /dev/null
+++ b/boost/units/physical_dimensions/magnetic_field_intensity.hpp
@@ -0,0 +1,30 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_MAGNETIC_FIELD_INTENSITY_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_MAGNETIC_FIELD_INTENSITY_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/current.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for magnetic field intensity : L^-1 I
+typedef derived_dimension<length_base_dimension,-1,
+ current_base_dimension,1>::type magnetic_field_intensity_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_MAGNETIC_FIELD_INTENSITY_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/magnetic_flux.hpp b/boost/units/physical_dimensions/magnetic_flux.hpp
new file mode 100644
index 0000000..c247e56
--- /dev/null
+++ b/boost/units/physical_dimensions/magnetic_flux.hpp
@@ -0,0 +1,34 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_MAGNETIC_FLUX_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_MAGNETIC_FLUX_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+#include <boost/units/physical_dimensions/current.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for magnetic flux : L^2 M T^-2 I^-1
+typedef derived_dimension<length_base_dimension,2,
+ mass_base_dimension,1,
+ time_base_dimension,-2,
+ current_base_dimension,-1>::type magnetic_flux_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_MAGNETIC_FLUX_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/magnetic_flux_density.hpp b/boost/units/physical_dimensions/magnetic_flux_density.hpp
new file mode 100644
index 0000000..d7fb7bb
--- /dev/null
+++ b/boost/units/physical_dimensions/magnetic_flux_density.hpp
@@ -0,0 +1,32 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_MAGNETIC_FLUX_DENSITY_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_MAGNETIC_FLUX_DENSITY_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+#include <boost/units/physical_dimensions/current.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for magnetic flux density : M T^-2 I^-1
+typedef derived_dimension<mass_base_dimension,1,
+ time_base_dimension,-2,
+ current_base_dimension,-1>::type magnetic_flux_density_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_MAGNETIC_FLUX_DENSITY_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/mass.hpp b/boost/units/physical_dimensions/mass.hpp
new file mode 100644
index 0000000..7aaa75c
--- /dev/null
+++ b/boost/units/physical_dimensions/mass.hpp
@@ -0,0 +1,49 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_MASS_BASE_DIMENSION_HPP
+#define BOOST_UNITS_MASS_BASE_DIMENSION_HPP
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_dimension.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// base dimension of mass
+struct mass_base_dimension :
+ boost::units::base_dimension<mass_base_dimension,-8>
+{ };
+
+} // namespace units
+
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::mass_base_dimension)
+
+#endif
+
+namespace boost {
+
+namespace units {
+
+/// dimension of mass (M)
+typedef mass_base_dimension::dimension_type mass_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_MASS_BASE_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/mass_density.hpp b/boost/units/physical_dimensions/mass_density.hpp
new file mode 100644
index 0000000..e632f24
--- /dev/null
+++ b/boost/units/physical_dimensions/mass_density.hpp
@@ -0,0 +1,30 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_MASS_DENSITY_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_MASS_DENSITY_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for mass density : L^-3 M
+typedef derived_dimension<length_base_dimension,-3,
+ mass_base_dimension,1>::type mass_density_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_MASS_DENSITY_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/molar_energy.hpp b/boost/units/physical_dimensions/molar_energy.hpp
new file mode 100644
index 0000000..2f83bbf
--- /dev/null
+++ b/boost/units/physical_dimensions/molar_energy.hpp
@@ -0,0 +1,34 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_MOLAR_ENERGY_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_MOLAR_ENERGY_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+#include <boost/units/physical_dimensions/amount.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for molar energy : L^2 M T^-2 N^-1
+typedef derived_dimension<length_base_dimension,2,
+ mass_base_dimension,1,
+ time_base_dimension,-2,
+ amount_base_dimension,-1>::type molar_energy_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_MOLAR_ENERGY_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/molar_heat_capacity.hpp b/boost/units/physical_dimensions/molar_heat_capacity.hpp
new file mode 100644
index 0000000..48e147b
--- /dev/null
+++ b/boost/units/physical_dimensions/molar_heat_capacity.hpp
@@ -0,0 +1,36 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_MOLAR_HEAT_CAPACITY_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_MOLAR_HEAT_CAPACITY_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+#include <boost/units/physical_dimensions/temperature.hpp>
+#include <boost/units/physical_dimensions/amount.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for molar heat capacity : L^2 M T^-2 Theta^-1 N^-1
+typedef derived_dimension<length_base_dimension,2,
+ mass_base_dimension,1,
+ time_base_dimension,-2,
+ temperature_base_dimension,-1,
+ amount_base_dimension,-1>::type molar_heat_capacity_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_MOLAR_HEAT_CAPACITY_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/moment_of_inertia.hpp b/boost/units/physical_dimensions/moment_of_inertia.hpp
new file mode 100644
index 0000000..58c85c8
--- /dev/null
+++ b/boost/units/physical_dimensions/moment_of_inertia.hpp
@@ -0,0 +1,32 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_MOMENT_OF_INERTIA_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_MOMENT_OF_INERTIA_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/plane_angle.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for moment of inertia : L^2 M QP^-2
+typedef derived_dimension<length_base_dimension,2,
+ mass_base_dimension,1,
+ plane_angle_base_dimension,-2>::type moment_of_inertia_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_MOMENT_OF_INERTIA_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/momentum.hpp b/boost/units/physical_dimensions/momentum.hpp
new file mode 100644
index 0000000..13e8b8c
--- /dev/null
+++ b/boost/units/physical_dimensions/momentum.hpp
@@ -0,0 +1,32 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_MOMENTUM_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_MOMENTUM_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for linear momentum : L M T^-1
+typedef derived_dimension<length_base_dimension,1,
+ mass_base_dimension,1,
+ time_base_dimension,-1>::type momentum_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_MOMENTUM_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/permeability.hpp b/boost/units/physical_dimensions/permeability.hpp
new file mode 100644
index 0000000..a0ea30c
--- /dev/null
+++ b/boost/units/physical_dimensions/permeability.hpp
@@ -0,0 +1,34 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_PERMEABILITY_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_PERMEABILITY_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+#include <boost/units/physical_dimensions/current.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for permeability : L M T^-2 I^-2
+typedef derived_dimension<length_base_dimension,1,
+ mass_base_dimension,1,
+ time_base_dimension,-2,
+ current_base_dimension,-2>::type permeability_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_PERMEABILITY_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/permittivity.hpp b/boost/units/physical_dimensions/permittivity.hpp
new file mode 100644
index 0000000..01994c5
--- /dev/null
+++ b/boost/units/physical_dimensions/permittivity.hpp
@@ -0,0 +1,34 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_PERMITTIVITY_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_PERMITTIVITY_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+#include <boost/units/physical_dimensions/current.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for permittivity : L^-3 M^-1 T^4 I^2
+typedef derived_dimension<length_base_dimension,-3,
+ mass_base_dimension,-1,
+ time_base_dimension,4,
+ current_base_dimension,2>::type permittivity_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_PERMITTIVITY_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/plane_angle.hpp b/boost/units/physical_dimensions/plane_angle.hpp
new file mode 100644
index 0000000..ae70032
--- /dev/null
+++ b/boost/units/physical_dimensions/plane_angle.hpp
@@ -0,0 +1,49 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_PLANE_ANGLE_BASE_DIMENSION_HPP
+#define BOOST_UNITS_PLANE_ANGLE_BASE_DIMENSION_HPP
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_dimension.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// base dimension of plane angle
+struct plane_angle_base_dimension :
+ boost::units::base_dimension<plane_angle_base_dimension,-2>
+{ };
+
+} // namespace units
+
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::plane_angle_base_dimension)
+
+#endif
+
+namespace boost {
+
+namespace units {
+
+/// base dimension of plane angle (QP)
+typedef plane_angle_base_dimension::dimension_type plane_angle_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_PLANE_ANGLE_BASE_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/power.hpp b/boost/units/physical_dimensions/power.hpp
new file mode 100644
index 0000000..77e04cf
--- /dev/null
+++ b/boost/units/physical_dimensions/power.hpp
@@ -0,0 +1,32 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_POWER_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_POWER_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for power : L^2 M T^-3
+typedef derived_dimension<length_base_dimension,2,
+ mass_base_dimension,1,
+ time_base_dimension,-3>::type power_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_POWER_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/pressure.hpp b/boost/units/physical_dimensions/pressure.hpp
new file mode 100644
index 0000000..666b4c7
--- /dev/null
+++ b/boost/units/physical_dimensions/pressure.hpp
@@ -0,0 +1,32 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_PRESSURE_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_PRESSURE_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for pressure : L^-1 M T^-2
+typedef derived_dimension<length_base_dimension,-1,
+ mass_base_dimension,1,
+ time_base_dimension,-2>::type pressure_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_PRESSURE_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/reluctance.hpp b/boost/units/physical_dimensions/reluctance.hpp
new file mode 100644
index 0000000..56be33b
--- /dev/null
+++ b/boost/units/physical_dimensions/reluctance.hpp
@@ -0,0 +1,34 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_RELUCTANCE_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_RELUCTANCE_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+#include <boost/units/physical_dimensions/current.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for reluctance : L^-2 M^-1 T^2 I^2
+typedef derived_dimension<length_base_dimension,-2,
+ mass_base_dimension,-1,
+ time_base_dimension,2,
+ current_base_dimension,2>::type reluctance_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_RELUCTANCE_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/resistance.hpp b/boost/units/physical_dimensions/resistance.hpp
new file mode 100644
index 0000000..3b1491d
--- /dev/null
+++ b/boost/units/physical_dimensions/resistance.hpp
@@ -0,0 +1,34 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_RESISTANCE_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_RESISTANCE_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+#include <boost/units/physical_dimensions/current.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for resistance : L^2 M T^-3 I^-2
+typedef derived_dimension<length_base_dimension,2,
+ mass_base_dimension,1,
+ time_base_dimension,-3,
+ current_base_dimension,-2>::type resistance_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_RESISTANCE_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/resistivity.hpp b/boost/units/physical_dimensions/resistivity.hpp
new file mode 100644
index 0000000..a82b900
--- /dev/null
+++ b/boost/units/physical_dimensions/resistivity.hpp
@@ -0,0 +1,34 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_RESISTIVITY_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_RESISTIVITY_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+#include <boost/units/physical_dimensions/current.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for resistivity : L^3 M T^-3 I^-2
+typedef derived_dimension<length_base_dimension,3,
+ mass_base_dimension,1,
+ time_base_dimension,-3,
+ current_base_dimension,-2>::type resistivity_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_RESISTIVITY_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/solid_angle.hpp b/boost/units/physical_dimensions/solid_angle.hpp
new file mode 100644
index 0000000..1d035c0
--- /dev/null
+++ b/boost/units/physical_dimensions/solid_angle.hpp
@@ -0,0 +1,49 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_SOLID_ANGLE_BASE_DIMENSION_HPP
+#define BOOST_UNITS_SOLID_ANGLE_BASE_DIMENSION_HPP
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_dimension.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// base dimension of solid angle
+struct solid_angle_base_dimension :
+ boost::units::base_dimension<solid_angle_base_dimension,-1>
+{ };
+
+} // namespace units
+
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::solid_angle_base_dimension)
+
+#endif
+
+namespace boost {
+
+namespace units {
+
+/// base dimension of solid angle (QS)
+typedef solid_angle_base_dimension::dimension_type solid_angle_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_SOLID_ANGLE_BASE_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/specific_energy.hpp b/boost/units/physical_dimensions/specific_energy.hpp
new file mode 100644
index 0000000..e74a293
--- /dev/null
+++ b/boost/units/physical_dimensions/specific_energy.hpp
@@ -0,0 +1,30 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_SPECIFIC_ENERGY_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_SPECIFIC_ENERGY_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for specific energy : L^2 T^-2
+typedef derived_dimension<length_base_dimension,2,
+ time_base_dimension,-2>::type specific_energy_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_SPECIFIC_ENERGY_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/specific_heat_capacity.hpp b/boost/units/physical_dimensions/specific_heat_capacity.hpp
new file mode 100644
index 0000000..9e48fae
--- /dev/null
+++ b/boost/units/physical_dimensions/specific_heat_capacity.hpp
@@ -0,0 +1,32 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_SPECIFIC_HEAT_CAPACITY_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_SPECIFIC_HEAT_CAPACITY_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+#include <boost/units/physical_dimensions/temperature.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for specific heat capacity : L^2 T^-2 Theta^-1
+typedef derived_dimension<length_base_dimension,2,
+ time_base_dimension,-2,
+ temperature_base_dimension,-1>::type specific_heat_capacity_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_SPECIFIC_HEAT_CAPACITY_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/specific_volume.hpp b/boost/units/physical_dimensions/specific_volume.hpp
new file mode 100644
index 0000000..85ed889
--- /dev/null
+++ b/boost/units/physical_dimensions/specific_volume.hpp
@@ -0,0 +1,30 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_SPECIFIC_VOLUME_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_SPECIFIC_VOLUME_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for specific volume : L^3 M^-1
+typedef derived_dimension<length_base_dimension,3,
+ mass_base_dimension,-1>::type specific_volume_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_SPECIFIC_VOLUME_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/stress.hpp b/boost/units/physical_dimensions/stress.hpp
new file mode 100644
index 0000000..d989c8c
--- /dev/null
+++ b/boost/units/physical_dimensions/stress.hpp
@@ -0,0 +1,32 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_STRESS_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_STRESS_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for stress : L^-1 M T^-2
+typedef derived_dimension<length_base_dimension,-1,
+ mass_base_dimension,1,
+ time_base_dimension,-2>::type stress_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_STRESS_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/surface_density.hpp b/boost/units/physical_dimensions/surface_density.hpp
new file mode 100644
index 0000000..898e8f4
--- /dev/null
+++ b/boost/units/physical_dimensions/surface_density.hpp
@@ -0,0 +1,30 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_SURFACE_DENSITY_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_SURFACE_DENSITY_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for surface density : L^-2 M
+typedef derived_dimension<length_base_dimension,-2,
+ mass_base_dimension,1>::type surface_density_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_SURFACE_DENSITY_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/surface_tension.hpp b/boost/units/physical_dimensions/surface_tension.hpp
new file mode 100644
index 0000000..630509f
--- /dev/null
+++ b/boost/units/physical_dimensions/surface_tension.hpp
@@ -0,0 +1,31 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_SURFACE_TENSION_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_SURFACE_TENSION_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for surface tension : M T^-2
+typedef derived_dimension<mass_base_dimension,1,
+ time_base_dimension,-2>::type surface_tension_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_SURFACE_TENSION_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/temperature.hpp b/boost/units/physical_dimensions/temperature.hpp
new file mode 100644
index 0000000..f6bc788
--- /dev/null
+++ b/boost/units/physical_dimensions/temperature.hpp
@@ -0,0 +1,49 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_TEMPERATURE_BASE_DIMENSION_HPP
+#define BOOST_UNITS_TEMPERATURE_BASE_DIMENSION_HPP
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_dimension.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// base dimension of temperature
+struct temperature_base_dimension :
+ boost::units::base_dimension<temperature_base_dimension,-5>
+{ };
+
+} // namespace units
+
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::temperature_base_dimension)
+
+#endif
+
+namespace boost {
+
+namespace units {
+
+/// dimension of temperature (Theta)
+typedef temperature_base_dimension::dimension_type temperature_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_TEMPERATURE_BASE_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/thermal_conductivity.hpp b/boost/units/physical_dimensions/thermal_conductivity.hpp
new file mode 100644
index 0000000..abc82c7
--- /dev/null
+++ b/boost/units/physical_dimensions/thermal_conductivity.hpp
@@ -0,0 +1,34 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_THERMAL_CONDUCTIVITY_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_THERMAL_CONDUCTIVITY_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+#include <boost/units/physical_dimensions/temperature.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for thermal_conductivity : L^1 M^1 T^-3 Theta^-1
+typedef derived_dimension<length_base_dimension,1,
+ mass_base_dimension,1,
+ time_base_dimension,-3,
+ temperature_base_dimension,-1>::type thermal_conductivity_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_THERMAL_CONDUCTIVITY_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/time.hpp b/boost/units/physical_dimensions/time.hpp
new file mode 100644
index 0000000..0b9a3e1
--- /dev/null
+++ b/boost/units/physical_dimensions/time.hpp
@@ -0,0 +1,49 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_TIME_BASE_DIMENSION_HPP
+#define BOOST_UNITS_TIME_BASE_DIMENSION_HPP
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_dimension.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// base dimension of time
+struct time_base_dimension :
+ boost::units::base_dimension<time_base_dimension,-7>
+{ };
+
+} // namespace units
+
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::time_base_dimension)
+
+#endif
+
+namespace boost {
+
+namespace units {
+
+/// dimension of time (T)
+typedef time_base_dimension::dimension_type time_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_TIME_BASE_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/torque.hpp b/boost/units/physical_dimensions/torque.hpp
new file mode 100644
index 0000000..61c41a1
--- /dev/null
+++ b/boost/units/physical_dimensions/torque.hpp
@@ -0,0 +1,34 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_TORQUE_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_TORQUE_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/mass.hpp>
+#include <boost/units/physical_dimensions/plane_angle.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for torque : L^2 M T^-2 QP^-1
+typedef derived_dimension<length_base_dimension,2,
+ mass_base_dimension,1,
+ time_base_dimension,-2,
+ plane_angle_base_dimension,-1>::type torque_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_TORQUE_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/velocity.hpp b/boost/units/physical_dimensions/velocity.hpp
new file mode 100644
index 0000000..eb3d412
--- /dev/null
+++ b/boost/units/physical_dimensions/velocity.hpp
@@ -0,0 +1,30 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_VELOCITY_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_VELOCITY_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+#include <boost/units/physical_dimensions/time.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for velocity : L T^-1
+typedef derived_dimension<length_base_dimension,1,
+ time_base_dimension,-1>::type velocity_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_VELOCITY_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/volume.hpp b/boost/units/physical_dimensions/volume.hpp
new file mode 100644
index 0000000..a2cdd88
--- /dev/null
+++ b/boost/units/physical_dimensions/volume.hpp
@@ -0,0 +1,28 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_VOLUME_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_VOLUME_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for volume : l^3
+typedef derived_dimension<length_base_dimension,3>::type volume_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_VOLUME_DERIVED_DIMENSION_HPP
diff --git a/boost/units/physical_dimensions/wavenumber.hpp b/boost/units/physical_dimensions/wavenumber.hpp
new file mode 100644
index 0000000..abaf0ac
--- /dev/null
+++ b/boost/units/physical_dimensions/wavenumber.hpp
@@ -0,0 +1,28 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_WAVENUMBER_DERIVED_DIMENSION_HPP
+#define BOOST_UNITS_WAVENUMBER_DERIVED_DIMENSION_HPP
+
+#include <boost/units/derived_dimension.hpp>
+#include <boost/units/physical_dimensions/length.hpp>
+
+namespace boost {
+
+namespace units {
+
+/// derived dimension for wavenumber : L^-1
+typedef derived_dimension<length_base_dimension,-1>::type wavenumber_dimension;
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_WAVENUMBER_DERIVED_DIMENSION_HPP
diff --git a/boost/units/pow.hpp b/boost/units/pow.hpp
new file mode 100644
index 0000000..1d856a5
--- /dev/null
+++ b/boost/units/pow.hpp
@@ -0,0 +1,112 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_POW_HPP
+#define BOOST_UNITS_POW_HPP
+
+#include <boost/math_fwd.hpp>
+#include <boost/type_traits/is_integral.hpp>
+
+#include <boost/units/operators.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/detail/static_rational_power.hpp>
+
+/// \file
+/// \brief Raise values to exponents known at compile-time.
+
+namespace boost {
+
+namespace units {
+
+/// raise a value to a @c static_rational power.
+template<class Rat,class Y>
+inline typename power_typeof_helper<Y,Rat>::type
+pow(const Y& x)
+{
+ return power_typeof_helper<Y,Rat>::value(x);
+}
+
+/// raise a value to an integer power.
+template<long N,class Y>
+inline typename power_typeof_helper<Y,static_rational<N> >::type
+pow(const Y& x)
+{
+ return power_typeof_helper<Y,static_rational<N> >::value(x);
+}
+
+#ifndef BOOST_UNITS_DOXYGEN
+
+/// raise @c T to a @c static_rational power.
+template<class T, long N,long D>
+struct power_typeof_helper<T, static_rational<N,D> >
+{
+ typedef typename mpl::if_<boost::is_integral<T>, double, T>::type internal_type;
+ typedef detail::static_rational_power_impl<static_rational<N, D>, internal_type> impl;
+ typedef typename impl::type type;
+
+ static type value(const T& x)
+ {
+ return impl::call(x);
+ }
+};
+
+/// raise @c float to a @c static_rational power.
+template<long N,long D>
+struct power_typeof_helper<float, static_rational<N,D> >
+{
+ // N.B. pathscale doesn't accept inheritance for some reason.
+ typedef power_typeof_helper<double, static_rational<N,D> > base;
+ typedef typename base::type type;
+ static type value(const double& x)
+ {
+ return base::value(x);
+ }
+};
+
+#endif
+
+/// take the @c static_rational root of a value.
+template<class Rat,class Y>
+typename root_typeof_helper<Y,Rat>::type
+root(const Y& x)
+{
+ return root_typeof_helper<Y,Rat>::value(x);
+}
+
+/// take the integer root of a value.
+template<long N,class Y>
+typename root_typeof_helper<Y,static_rational<N> >::type
+root(const Y& x)
+{
+ return root_typeof_helper<Y,static_rational<N> >::value(x);
+}
+
+#ifndef BOOST_UNITS_DOXYGEN
+
+/// take @c static_rational root of an @c T
+template<class T, long N,long D>
+struct root_typeof_helper<T,static_rational<N,D> >
+{
+ // N.B. pathscale doesn't accept inheritance for some reason.
+ typedef power_typeof_helper<T, static_rational<D,N> > base;
+ typedef typename base::type type;
+ static type value(const T& x)
+ {
+ return(base::value(x));
+ }
+};
+
+#endif
+
+} // namespace units
+
+} // namespace boost
+
+#endif // BOOST_UNITS_STATIC_RATIONAL_HPP
diff --git a/boost/units/quantity.hpp b/boost/units/quantity.hpp
new file mode 100644
index 0000000..4fe916d
--- /dev/null
+++ b/boost/units/quantity.hpp
@@ -0,0 +1,1218 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2007-2008 Steven Watanabe
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_QUANTITY_HPP
+#define BOOST_UNITS_QUANTITY_HPP
+
+#include <algorithm>
+
+#include <boost/config.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/mpl/or.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_arithmetic.hpp>
+#include <boost/type_traits/is_convertible.hpp>
+#include <boost/type_traits/is_integral.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+#include <boost/units/conversion.hpp>
+#include <boost/units/dimensionless_type.hpp>
+#include <boost/units/homogeneous_system.hpp>
+#include <boost/units/operators.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/units_fwd.hpp>
+#include <boost/units/detail/dimensionless_unit.hpp>
+
+namespace boost {
+
+namespace units {
+
+namespace detail {
+
+template<class T, class Enable = void>
+struct is_base_unit : mpl::false_ {};
+
+template<class T>
+struct is_base_unit<T, typename T::boost_units_is_base_unit_type> : mpl::true_ {};
+
+template<class Source, class Destination>
+struct is_narrowing_conversion_impl : mpl::bool_<(sizeof(Source) > sizeof(Destination))> {};
+
+template<class Source, class Destination>
+struct is_non_narrowing_conversion :
+ mpl::and_<
+ boost::is_convertible<Source, Destination>,
+ mpl::not_<
+ mpl::and_<
+ boost::is_arithmetic<Source>,
+ boost::is_arithmetic<Destination>,
+ mpl::or_<
+ mpl::and_<
+ is_integral<Destination>,
+ mpl::not_<is_integral<Source> >
+ >,
+ is_narrowing_conversion_impl<Source, Destination>
+ >
+ >
+ >
+ >
+{};
+
+template<>
+struct is_non_narrowing_conversion<long double, double> : mpl::false_ {};
+
+// msvc 7.1 needs extra disambiguation
+template<class T, class U>
+struct disable_if_is_same
+{
+ typedef void type;
+};
+
+template<class T>
+struct disable_if_is_same<T, T> {};
+
+}
+
+/// class declaration
+template<class Unit,class Y = double>
+class quantity
+{
+ // base units are not the same as units.
+ BOOST_MPL_ASSERT_NOT((detail::is_base_unit<Unit>));
+ enum { force_instantiation_of_unit = sizeof(Unit) };
+ typedef void (quantity::*unspecified_null_pointer_constant_type)(int*******);
+ public:
+ typedef quantity<Unit,Y> this_type;
+
+ typedef Y value_type;
+ typedef Unit unit_type;
+
+ quantity() : val_()
+ {
+ BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y);
+ }
+
+ quantity(unspecified_null_pointer_constant_type) : val_()
+ {
+ BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y);
+ }
+
+ quantity(const this_type& source) : val_(source.val_)
+ {
+ BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y);
+ }
+
+ // Need to make sure that the destructor of
+ // Unit which contains the checking is instantiated,
+ // on sun.
+ #ifdef __SUNPRO_CC
+ ~quantity() {
+ unit_type force_unit_instantiation;
+ }
+ #endif
+
+ //~quantity() { }
+
+ this_type& operator=(const this_type& source)
+ {
+ val_ = source.val_;
+
+ return *this;
+ }
+
+ #ifndef BOOST_NO_SFINAE
+
+ /// implicit conversion between value types is allowed if allowed for value types themselves
+ template<class YY>
+ quantity(const quantity<Unit,YY>& source,
+ typename boost::enable_if<detail::is_non_narrowing_conversion<YY, Y> >::type* = 0) :
+ val_(source.value())
+ {
+ BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y);
+ }
+
+ /// implicit conversion between value types is not allowed if not allowed for value types themselves
+ template<class YY>
+ explicit quantity(const quantity<Unit,YY>& source,
+ typename boost::disable_if<detail::is_non_narrowing_conversion<YY, Y> >::type* = 0) :
+ val_(static_cast<Y>(source.value()))
+ {
+ BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y);
+ }
+
+ #else
+
+ /// implicit conversion between value types is allowed if allowed for value types themselves
+ template<class YY>
+ quantity(const quantity<Unit,YY>& source) :
+ val_(source.value())
+ {
+ BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y);
+ BOOST_STATIC_ASSERT((boost::is_convertible<YY, Y>::value == true));
+ }
+
+ #endif
+
+ /// implicit assignment between value types is allowed if allowed for value types themselves
+ template<class YY>
+ this_type& operator=(const quantity<Unit,YY>& source)
+ {
+ BOOST_STATIC_ASSERT((boost::is_convertible<YY, Y>::value == true));
+
+ *this = this_type(source);
+
+ return *this;
+ }
+
+ #ifndef BOOST_NO_SFINAE
+
+ /// explicit conversion between different unit systems is allowed if implicit conversion is disallowed
+ template<class Unit2,class YY>
+ explicit
+ quantity(const quantity<Unit2,YY>& source,
+ typename boost::disable_if<
+ mpl::and_<
+ //is_implicitly_convertible should be undefined when the
+ //units are not convertible at all
+ typename is_implicitly_convertible<Unit2,Unit>::type,
+ detail::is_non_narrowing_conversion<YY, Y>
+ >,
+ typename detail::disable_if_is_same<Unit, Unit2>::type
+ >::type* = 0)
+ : val_(conversion_helper<quantity<Unit2,YY>,this_type>::convert(source).value())
+ {
+ BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y);
+ BOOST_STATIC_ASSERT((boost::is_convertible<YY,Y>::value == true));
+ }
+
+ /// implicit conversion between different unit systems is allowed if each fundamental dimension is implicitly convertible
+ template<class Unit2,class YY>
+ quantity(const quantity<Unit2,YY>& source,
+ typename boost::enable_if<
+ mpl::and_<
+ typename is_implicitly_convertible<Unit2,Unit>::type,
+ detail::is_non_narrowing_conversion<YY, Y>
+ >,
+ typename detail::disable_if_is_same<Unit, Unit2>::type
+ >::type* = 0)
+ : val_(conversion_helper<quantity<Unit2,YY>,this_type>::convert(source).value())
+ {
+ BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y);
+ BOOST_STATIC_ASSERT((boost::is_convertible<YY,Y>::value == true));
+ }