|
Boost-Commit : |
From: steven_at_[hidden]
Date: 2008-05-15 20:52:03
Author: steven_watanabe
Date: 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
New Revision: 45412
URL: http://svn.boost.org/trac/boost/changeset/45412
Log:
Made conversions work whenever the corresponding base units are included
Added:
sandbox/units/boost/units/systems/base_units/detail/
sandbox/units/boost/units/systems/base_units/detail/conversions.hpp
- copied, changed from r45403, /sandbox/units/boost/units/systems/base_units.hpp
sandbox/units/libs/units/test/check_conversion_defs.cpp (contents, props changed)
Text files modified:
sandbox/units/boost/units/systems/base_units.hpp | 36 -----
sandbox/units/boost/units/systems/base_units/ampere.hpp | 4
sandbox/units/boost/units/systems/base_units/biot.hpp | 2
sandbox/units/boost/units/systems/base_units/candela.hpp | 5
sandbox/units/boost/units/systems/base_units/celsius.hpp | 4
sandbox/units/boost/units/systems/base_units/centimeter.hpp | 2
sandbox/units/boost/units/systems/base_units/degree.hpp | 4
sandbox/units/boost/units/systems/base_units/detail/conversions.hpp | 236 ++++++++++++++++++++++++++++-----------
sandbox/units/boost/units/systems/base_units/fahrenheit.hpp | 4
sandbox/units/boost/units/systems/base_units/foot.hpp | 4
sandbox/units/boost/units/systems/base_units/gradian.hpp | 4
sandbox/units/boost/units/systems/base_units/gram.hpp | 4
sandbox/units/boost/units/systems/base_units/hour.hpp | 4
sandbox/units/boost/units/systems/base_units/inch.hpp | 4
sandbox/units/boost/units/systems/base_units/kelvin.hpp | 4
sandbox/units/boost/units/systems/base_units/kilogram.hpp | 2
sandbox/units/boost/units/systems/base_units/meter.hpp | 4
sandbox/units/boost/units/systems/base_units/mile.hpp | 4
sandbox/units/boost/units/systems/base_units/minute.hpp | 4
sandbox/units/boost/units/systems/base_units/mole.hpp | 4
sandbox/units/boost/units/systems/base_units/radian.hpp | 5
sandbox/units/boost/units/systems/base_units/revolution.hpp | 4
sandbox/units/boost/units/systems/base_units/second.hpp | 4
sandbox/units/boost/units/systems/base_units/steradian.hpp | 4
sandbox/units/boost/units/systems/base_units/yard.hpp | 5
sandbox/units/boost/units/systems/metric/year.hpp | 2
sandbox/units/boost/units/systems/survey/link.hpp | 2
sandbox/units/boost/units/systems/us/minim.hpp | 2
sandbox/units/libs/units/test/Jamfile.v2 | 8 +
29 files changed, 244 insertions(+), 131 deletions(-)
Modified: sandbox/units/boost/units/systems/base_units.hpp
==============================================================================
--- sandbox/units/boost/units/systems/base_units.hpp (original)
+++ sandbox/units/boost/units/systems/base_units.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -2,7 +2,7 @@
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
-// Copyright (C) 2008 Steven Watanabe
+// 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
@@ -41,38 +41,4 @@
#include <boost/units/systems/base_units/steradian.hpp>
#include <boost/units/systems/base_units/yard.hpp>
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::foot_base_unit, boost::units::meter_base_unit, double, 0.3048);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::inch_base_unit, boost::units::meter_base_unit, double, 25.4e-3);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::yard_base_unit, boost::units::meter_base_unit, double, 0.9144);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::mile_base_unit, boost::units::meter_base_unit, double, 1609.344);
-
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::mile_base_unit, boost::units::yard_base_unit, double, 1760.0);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::mile_base_unit, boost::units::foot_base_unit, double, 5280.0);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::mile_base_unit, boost::units::inch_base_unit, double, 63360.0);
-
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::yard_base_unit, boost::units::foot_base_unit, double, 3.0);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::yard_base_unit, boost::units::inch_base_unit, double, 36.0);
-
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::foot_base_unit, boost::units::inch_base_unit, double, 12.0);
-
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::hour_base_unit, boost::units::minute_base_unit, double, 60.0);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::hour_base_unit, boost::units::second_base_unit, double, 3600.0);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::minute_base_unit, boost::units::second_base_unit, double, 60.0);
-
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::kelvin_base_unit, boost::units::celsius_base_unit, one, one());
-BOOST_UNITS_DEFINE_CONVERSION_OFFSET(boost::units::kelvin_base_unit, boost::units::celsius_base_unit, double, -273.15);
-
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::kelvin_base_unit, boost::units::fahrenheit_base_unit, double, 9.0/5.0);
-BOOST_UNITS_DEFINE_CONVERSION_OFFSET(boost::units::kelvin_base_unit, boost::units::fahrenheit_base_unit, double, -273.15 * 9.0 / 5.0 + 32.0);
-
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::celsius_base_unit, boost::units::fahrenheit_base_unit, double, 9.0/5.0);
-BOOST_UNITS_DEFINE_CONVERSION_OFFSET(boost::units::celsius_base_unit, boost::units::fahrenheit_base_unit, double, 32.0);
-
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::radian_base_unit, boost::units::degree_base_unit, double, 180/3.14159265358979323846);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::radian_base_unit, boost::units::gradian_base_unit, double, 200/3.14159265358979323846);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::radian_base_unit, boost::units::revolution_base_unit, double, 0.5/3.14159265358979323846);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::degree_base_unit, boost::units::gradian_base_unit, double, 10/9.);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::degree_base_unit, boost::units::revolution_base_unit, double, 1/360.);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::gradian_base_unit, boost::units::revolution_base_unit, double, 1/400.);
-
#endif // BOOST_UNITS_OTHER_UNITS_HPP_INCLUDED
Modified: sandbox/units/boost/units/systems/base_units/ampere.hpp
==============================================================================
--- sandbox/units/boost/units/systems/base_units/ampere.hpp (original)
+++ sandbox/units/boost/units/systems/base_units/ampere.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -2,7 +2,7 @@
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
-// Copyright (C) 2008 Steven Watanabe
+// 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
@@ -39,4 +39,6 @@
#endif
+#include <boost/units/systems/base_units/detail/conversions.hpp>
+
#endif // BOOST_UNITS_AMPERE_BASE_UNIT_HPP
Modified: sandbox/units/boost/units/systems/base_units/biot.hpp
==============================================================================
--- sandbox/units/boost/units/systems/base_units/biot.hpp (original)
+++ sandbox/units/boost/units/systems/base_units/biot.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -2,7 +2,7 @@
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
-// Copyright (C) 2008 Steven Watanabe
+// 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
Modified: sandbox/units/boost/units/systems/base_units/candela.hpp
==============================================================================
--- sandbox/units/boost/units/systems/base_units/candela.hpp (original)
+++ sandbox/units/boost/units/systems/base_units/candela.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -2,7 +2,7 @@
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
-// Copyright (C) 2008 Steven Watanabe
+// 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
@@ -37,7 +37,8 @@
BOOST_TYPEOF_REGISTER_TYPE(boost::units::candela_base_unit)
-
#endif
+#include <boost/units/systems/base_units/detail/conversions.hpp>
+
#endif // BOOST_UNITS_CANDELA_BASE_UNIT_HPP
Modified: sandbox/units/boost/units/systems/base_units/celsius.hpp
==============================================================================
--- sandbox/units/boost/units/systems/base_units/celsius.hpp (original)
+++ sandbox/units/boost/units/systems/base_units/celsius.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -2,7 +2,7 @@
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
-// Copyright (C) 2008 Steven Watanabe
+// 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
@@ -39,4 +39,6 @@
#endif
+#include <boost/units/systems/base_units/detail/conversions.hpp>
+
#endif // BOOST_UNITS_CELSIUS_BASE_UNIT_HPP
Modified: sandbox/units/boost/units/systems/base_units/centimeter.hpp
==============================================================================
--- sandbox/units/boost/units/systems/base_units/centimeter.hpp (original)
+++ sandbox/units/boost/units/systems/base_units/centimeter.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -2,7 +2,7 @@
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
-// Copyright (C) 2008 Steven Watanabe
+// 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
Modified: sandbox/units/boost/units/systems/base_units/degree.hpp
==============================================================================
--- sandbox/units/boost/units/systems/base_units/degree.hpp (original)
+++ sandbox/units/boost/units/systems/base_units/degree.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -2,7 +2,7 @@
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
-// Copyright (C) 2008 Steven Watanabe
+// 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
@@ -39,4 +39,6 @@
#endif
+#include <boost/units/systems/base_units/detail/conversions.hpp>
+
#endif // BOOST_UNITS_DEGREE_BASE_UNIT_HPP
Copied: sandbox/units/boost/units/systems/base_units/detail/conversions.hpp (from r45403, /sandbox/units/boost/units/systems/base_units.hpp)
==============================================================================
--- /sandbox/units/boost/units/systems/base_units.hpp (original)
+++ sandbox/units/boost/units/systems/base_units/detail/conversions.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -2,77 +2,179 @@
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
-// Copyright (C) 2008 Steven Watanabe
+// 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_OTHER_UNITS_HPP_INCLUDED
-#define BOOST_UNITS_OTHER_UNITS_HPP_INCLUDED
+// No include guards. This header is intended to be included
+// multiple times.
-#include <string>
+// units of length
-#include <boost/units/config.hpp>
-#include <boost/units/base_unit.hpp>
-#include <boost/units/absolute.hpp>
-
-#include <boost/units/systems/base_units/ampere.hpp>
-#include <boost/units/systems/base_units/biot.hpp>
-#include <boost/units/systems/base_units/candela.hpp>
-#include <boost/units/systems/base_units/celsius.hpp>
-#include <boost/units/systems/base_units/centimeter.hpp>
-#include <boost/units/systems/base_units/degree.hpp>
-#include <boost/units/systems/base_units/fahrenheit.hpp>
-#include <boost/units/systems/base_units/foot.hpp>
-#include <boost/units/systems/base_units/gradian.hpp>
-#include <boost/units/systems/base_units/gram.hpp>
-#include <boost/units/systems/base_units/hour.hpp>
-#include <boost/units/systems/base_units/inch.hpp>
-#include <boost/units/systems/base_units/kelvin.hpp>
-#include <boost/units/systems/base_units/kilogram.hpp>
-#include <boost/units/systems/base_units/meter.hpp>
-#include <boost/units/systems/base_units/mile.hpp>
-#include <boost/units/systems/base_units/minute.hpp>
-#include <boost/units/systems/base_units/mole.hpp>
-#include <boost/units/systems/base_units/radian.hpp>
-#include <boost/units/systems/base_units/revolution.hpp>
-#include <boost/units/systems/base_units/second.hpp>
-#include <boost/units/systems/base_units/steradian.hpp>
-#include <boost/units/systems/base_units/yard.hpp>
-
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::foot_base_unit, boost::units::meter_base_unit, double, 0.3048);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::inch_base_unit, boost::units::meter_base_unit, double, 25.4e-3);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::yard_base_unit, boost::units::meter_base_unit, double, 0.9144);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::mile_base_unit, boost::units::meter_base_unit, double, 1609.344);
-
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::mile_base_unit, boost::units::yard_base_unit, double, 1760.0);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::mile_base_unit, boost::units::foot_base_unit, double, 5280.0);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::mile_base_unit, boost::units::inch_base_unit, double, 63360.0);
-
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::yard_base_unit, boost::units::foot_base_unit, double, 3.0);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::yard_base_unit, boost::units::inch_base_unit, double, 36.0);
-
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::foot_base_unit, boost::units::inch_base_unit, double, 12.0);
-
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::hour_base_unit, boost::units::minute_base_unit, double, 60.0);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::hour_base_unit, boost::units::second_base_unit, double, 3600.0);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::minute_base_unit, boost::units::second_base_unit, double, 60.0);
-
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::kelvin_base_unit, boost::units::celsius_base_unit, one, one());
-BOOST_UNITS_DEFINE_CONVERSION_OFFSET(boost::units::kelvin_base_unit, boost::units::celsius_base_unit, double, -273.15);
-
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::kelvin_base_unit, boost::units::fahrenheit_base_unit, double, 9.0/5.0);
-BOOST_UNITS_DEFINE_CONVERSION_OFFSET(boost::units::kelvin_base_unit, boost::units::fahrenheit_base_unit, double, -273.15 * 9.0 / 5.0 + 32.0);
-
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::celsius_base_unit, boost::units::fahrenheit_base_unit, double, 9.0/5.0);
-BOOST_UNITS_DEFINE_CONVERSION_OFFSET(boost::units::celsius_base_unit, boost::units::fahrenheit_base_unit, double, 32.0);
-
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::radian_base_unit, boost::units::degree_base_unit, double, 180/3.14159265358979323846);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::radian_base_unit, boost::units::gradian_base_unit, double, 200/3.14159265358979323846);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::radian_base_unit, boost::units::revolution_base_unit, double, 0.5/3.14159265358979323846);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::degree_base_unit, boost::units::gradian_base_unit, double, 10/9.);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::degree_base_unit, boost::units::revolution_base_unit, double, 1/360.);
-BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::gradian_base_unit, boost::units::revolution_base_unit, double, 1/400.);
-
-#endif // BOOST_UNITS_OTHER_UNITS_HPP_INCLUDED
+#if defined(BOOST_UNITS_METER_BASE_UNIT_HPP) && defined(BOOST_UNITS_FOOT_BASE_UNIT_HPP) &&\
+ !defined(BOOST_UNITS_SYSTEMS_FOOT_TO_METER_CONVERSION_DEFINED)
+ #define BOOST_UNITS_SYSTEMS_FOOT_TO_METER_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::foot_base_unit, boost::units::meter_base_unit, double, 0.3048);
+#endif
+
+#if defined(BOOST_UNITS_METER_BASE_UNIT_HPP) && defined(BOOST_UNITS_INCH_BASE_UNIT_HPP) &&\
+ !defined(BOOST_UNITS_SYSTEMS_INCH_TO_METER_CONVERSION_DEFINED)
+ #define BOOST_UNITS_SYSTEMS_INCH_TO_METER_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::inch_base_unit, boost::units::meter_base_unit, double, 25.4e-3);
+#endif
+
+#if defined(BOOST_UNITS_METER_BASE_UNIT_HPP) && defined(BOOST_UNITS_YARD_BASE_UNIT_HPP) &&\
+ !defined(BOOST_UNITS_SYSTEMS_YARD_TO_METER_CONVERSION_DEFINED)
+ #define BOOST_UNITS_SYSTEMS_YARD_TO_METER_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::yard_base_unit, boost::units::meter_base_unit, double, 0.9144);
+#endif
+
+#if defined(BOOST_UNITS_METER_BASE_UNIT_HPP) && defined(BOOST_UNITS_MILE_BASE_UNIT_HPP) &&\
+ !defined(BOOST_UNITS_SYSTEMS_MILE_TO_METER_CONVERSION_DEFINED)
+ #define BOOST_UNITS_SYSTEMS_MILE_TO_METER_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::mile_base_unit, boost::units::meter_base_unit, double, 1609.344);
+#endif
+
+#if defined(BOOST_UNITS_MILE_BASE_UNIT_HPP) && defined(BOOST_UNITS_YARD_BASE_UNIT_HPP) &&\
+ !defined(BOOST_UNITS_SYSTEMS_MILE_TO_YARD_CONVERSION_DEFINED)
+ #define BOOST_UNITS_SYSTEMS_MILE_TO_YARD_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::mile_base_unit, boost::units::yard_base_unit, double, 1760.0);
+#endif
+
+#if defined(BOOST_UNITS_MILE_BASE_UNIT_HPP) && defined(BOOST_UNITS_FOOT_BASE_UNIT_HPP) &&\
+ !defined(BOOST_UNITS_SYSTEMS_MILE_TO_FOOT_CONVERSION_DEFINED)
+ #define BOOST_UNITS_SYSTEMS_MILE_TO_FOOT_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::mile_base_unit, boost::units::foot_base_unit, double, 5280.0);
+#endif
+
+#if defined(BOOST_UNITS_MILE_BASE_UNIT_HPP) && defined(BOOST_UNITS_INCH_BASE_UNIT_HPP) &&\
+ !defined(BOOST_UNITS_SYSTEMS_MILE_TO_INCH_CONVERSION_DEFINED)
+ #define BOOST_UNITS_SYSTEMS_MILE_TO_INCH_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::mile_base_unit, boost::units::inch_base_unit, double, 63360.0);
+#endif
+
+#if defined(BOOST_UNITS_YARD_BASE_UNIT_HPP) && defined(BOOST_UNITS_FOOT_BASE_UNIT_HPP) &&\
+ !defined(BOOST_UNITS_SYSTEMS_YARD_TO_FOOT_CONVERSION_DEFINED)
+ #define BOOST_UNITS_SYSTEMS_YARD_TO_FOOT_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::yard_base_unit, boost::units::foot_base_unit, double, 3.0);
+#endif
+
+#if defined(BOOST_UNITS_YARD_BASE_UNIT_HPP) && defined(BOOST_UNITS_INCH_BASE_UNIT_HPP) &&\
+ !defined(BOOST_UNITS_SYSTEMS_YARD_TO_INCH_CONVERSION_DEFINED)
+ #define BOOST_UNITS_SYSTEMS_YARD_TO_INCH_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::yard_base_unit, boost::units::inch_base_unit, double, 36.0);
+#endif
+
+#if defined(BOOST_UNITS_FOOT_BASE_UNIT_HPP) && defined(BOOST_UNITS_INCH_BASE_UNIT_HPP) &&\
+ !defined(BOOST_UNITS_SYSTEMS_FOOT_TO_INCH_CONVERSION_DEFINED)
+ #define BOOST_UNITS_SYSTEMS_FOOT_TO_INCH_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::foot_base_unit, boost::units::inch_base_unit, double, 12.0);
+#endif
+
+// units of time
+
+#if defined(BOOST_UNITS_HOUR_BASE_UNIT_HPP) && defined(BOOST_UNITS_MINUTE_BASE_UNIT_HPP) &&\
+ !defined(BOOST_UNITS_SYSTEMS_HOUR_TO_MINUTE_CONVERSION_DEFINED)
+ #define BOOST_UNITS_SYSTEMS_HOUR_TO_MINUTE_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::hour_base_unit, boost::units::minute_base_unit, double, 60.0);
+#endif
+
+#if defined(BOOST_UNITS_HOUR_BASE_UNIT_HPP) && defined(BOOST_UNITS_SECOND_BASE_UNIT_HPP) &&\
+ !defined(BOOST_UNITS_SYSTEMS_HOUR_TO_SECOND_CONVERSION_DEFINED)
+ #define BOOST_UNITS_SYSTEMS_HOUR_TO_SECOND_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::hour_base_unit, boost::units::second_base_unit, double, 3600.0);
+#endif
+
+#if defined(BOOST_UNITS_MINUTE_BASE_UNIT_HPP) && defined(BOOST_UNITS_SECOND_BASE_UNIT_HPP) &&\
+ !defined(BOOST_UNITS_SYSTEMS_MINUTE_TO_SECOND_CONVERSION_DEFINED)
+ #define BOOST_UNITS_SYSTEMS_MINUTE_TO_SECOND_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::minute_base_unit, boost::units::second_base_unit, double, 60.0);
+#endif
+
+// units of temperature
+
+#if defined(BOOST_UNITS_KELVIN_BASE_UNIT_HPP) && defined(BOOST_UNITS_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::kelvin_base_unit, boost::units::celsius_base_unit, one, one());
+ BOOST_UNITS_DEFINE_CONVERSION_OFFSET(boost::units::kelvin_base_unit, boost::units::celsius_base_unit, double, -273.15);
+#endif
+
+#if defined(BOOST_UNITS_KELVIN_BASE_UNIT_HPP) && defined(BOOST_UNITS_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::kelvin_base_unit, boost::units::fahrenheit_base_unit, double, 9.0/5.0);
+ BOOST_UNITS_DEFINE_CONVERSION_OFFSET(boost::units::kelvin_base_unit, boost::units::fahrenheit_base_unit, double, -273.15 * 9.0 / 5.0 + 32.0);
+#endif
+
+#if defined(BOOST_UNITS_CELSIUS_BASE_UNIT_HPP) && defined(BOOST_UNITS_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::celsius_base_unit, boost::units::fahrenheit_base_unit, double, 9.0/5.0);
+ BOOST_UNITS_DEFINE_CONVERSION_OFFSET(boost::units::celsius_base_unit, boost::units::fahrenheit_base_unit, double, 32.0);
+#endif
+
+// units of angle.
+
+#if defined(BOOST_UNITS_RADIAN_BASE_UNIT_HPP) && defined(BOOST_UNITS_DEGREE_BASE_UNIT_HPP) &&\
+ !defined(BOOST_UNITS_SYSTEMS_RADIAN_TO_DEGREE_CONVERSION_DEFINED)
+ #define BOOST_UNITS_SYSTEMS_RADIAN_TO_DEGREE_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::radian_base_unit, boost::units::degree_base_unit, double, 180/3.14159265358979323846);
+#endif
+
+#if defined(BOOST_UNITS_RADIAN_BASE_UNIT_HPP) && defined(BOOST_UNITS_GRADIAN_BASE_UNIT_HPP) &&\
+ !defined(BOOST_UNITS_SYSTEMS_RADIAN_TO_GRADIAN_CONVERSION_DEFINED)
+ #define BOOST_UNITS_SYSTEMS_RADIAN_TO_GRADIAN_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::radian_base_unit, boost::units::gradian_base_unit, double, 200/3.14159265358979323846);
+#endif
+
+#if defined(BOOST_UNITS_RADIAN_BASE_UNIT_HPP) && defined(BOOST_UNITS_REVOLUTION_BASE_UNIT_HPP) &&\
+ !defined(BOOST_UNITS_SYSTEMS_RADIAN_TO_REVOLUTION_CONVERSION_DEFINED)
+ #define BOOST_UNITS_SYSTEMS_RADIAN_TO_REVOLUTION_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::radian_base_unit, boost::units::revolution_base_unit, double, 0.5/3.14159265358979323846);
+#endif
+
+#if defined(BOOST_UNITS_DEGREE_BASE_UNIT_HPP) && defined(BOOST_UNITS_GRADIAN_BASE_UNIT_HPP) &&\
+ !defined(BOOST_UNITS_SYSTEMS_DEGREE_TO_GRADIAN_CONVERSION_DEFINED)
+ #define BOOST_UNITS_SYSTEMS_DEGREE_TO_GRADIAN_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::degree_base_unit, boost::units::gradian_base_unit, double, 10/9.);
+#endif
+
+#if defined(BOOST_UNITS_DEGREE_BASE_UNIT_HPP) && defined(BOOST_UNITS_REVOLUTION_BASE_UNIT_HPP) &&\
+ !defined(BOOST_UNITS_SYSTEMS_DEGREE_TO_REVOLUTION_CONVERSION_DEFINED)
+ #define BOOST_UNITS_SYSTEMS_DEGREE_TO_REVOLUTION_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::degree_base_unit, boost::units::revolution_base_unit, double, 1/360.);
+#endif
+
+#if defined(BOOST_UNITS_GRADIAN_BASE_UNIT_HPP) && defined(BOOST_UNITS_REVOLUTION_BASE_UNIT_HPP) &&\
+ !defined(BOOST_UNITS_SYSTEMS_GRADIAN_TO_REVOLUTION_CONVERSION_DEFINED)
+ #define BOOST_UNITS_SYSTEMS_GRADIAN_TO_REVOLUTION_CONVERSION_DEFINED
+ #include <boost/units/conversion.hpp>
+ BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::gradian_base_unit, boost::units::revolution_base_unit, double, 1/400.);
+#endif
Modified: sandbox/units/boost/units/systems/base_units/fahrenheit.hpp
==============================================================================
--- sandbox/units/boost/units/systems/base_units/fahrenheit.hpp (original)
+++ sandbox/units/boost/units/systems/base_units/fahrenheit.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -2,7 +2,7 @@
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
-// Copyright (C) 2008 Steven Watanabe
+// 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
@@ -39,4 +39,6 @@
#endif
+#include <boost/units/systems/base_units/detail/conversions.hpp>
+
#endif // BOOST_UNITS_FAHRENHEIT_BASE_UNIT_HPP
Modified: sandbox/units/boost/units/systems/base_units/foot.hpp
==============================================================================
--- sandbox/units/boost/units/systems/base_units/foot.hpp (original)
+++ sandbox/units/boost/units/systems/base_units/foot.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -2,7 +2,7 @@
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
-// Copyright (C) 2008 Steven Watanabe
+// 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
@@ -39,4 +39,6 @@
#endif
+#include <boost/units/systems/base_units/detail/conversions.hpp>
+
#endif // BOOST_UNITS_FOOT_BASE_UNIT_HPP
Modified: sandbox/units/boost/units/systems/base_units/gradian.hpp
==============================================================================
--- sandbox/units/boost/units/systems/base_units/gradian.hpp (original)
+++ sandbox/units/boost/units/systems/base_units/gradian.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -2,7 +2,7 @@
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
-// Copyright (C) 2008 Steven Watanabe
+// 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
@@ -39,4 +39,6 @@
#endif
+#include <boost/units/systems/base_units/detail/conversions.hpp>
+
#endif // BOOST_UNITS_GRADIAN_BASE_UNIT_HPP
Modified: sandbox/units/boost/units/systems/base_units/gram.hpp
==============================================================================
--- sandbox/units/boost/units/systems/base_units/gram.hpp (original)
+++ sandbox/units/boost/units/systems/base_units/gram.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -2,7 +2,7 @@
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
-// Copyright (C) 2008 Steven Watanabe
+// 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
@@ -40,4 +40,6 @@
#endif
+#include <boost/units/systems/base_units/detail/conversions.hpp>
+
#endif // BOOST_UNITS_GRAM_BASE_UNIT_HPP
Modified: sandbox/units/boost/units/systems/base_units/hour.hpp
==============================================================================
--- sandbox/units/boost/units/systems/base_units/hour.hpp (original)
+++ sandbox/units/boost/units/systems/base_units/hour.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -2,7 +2,7 @@
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
-// Copyright (C) 2008 Steven Watanabe
+// 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
@@ -39,4 +39,6 @@
#endif
+#include <boost/units/systems/base_units/detail/conversions.hpp>
+
#endif // BOOST_UNITS_HOUR_BASE_UNIT_HPP
Modified: sandbox/units/boost/units/systems/base_units/inch.hpp
==============================================================================
--- sandbox/units/boost/units/systems/base_units/inch.hpp (original)
+++ sandbox/units/boost/units/systems/base_units/inch.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -2,7 +2,7 @@
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
-// Copyright (C) 2008 Steven Watanabe
+// 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
@@ -39,4 +39,6 @@
#endif
+#include <boost/units/systems/base_units/detail/conversions.hpp>
+
#endif // BOOST_UNITS_INCH_BASE_UNIT_HPP
Modified: sandbox/units/boost/units/systems/base_units/kelvin.hpp
==============================================================================
--- sandbox/units/boost/units/systems/base_units/kelvin.hpp (original)
+++ sandbox/units/boost/units/systems/base_units/kelvin.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -2,7 +2,7 @@
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
-// Copyright (C) 2008 Steven Watanabe
+// 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
@@ -39,4 +39,6 @@
#endif
+#include <boost/units/systems/base_units/detail/conversions.hpp>
+
#endif // BOOST_UNITS_KELVIN_BASE_UNIT_HPP
Modified: sandbox/units/boost/units/systems/base_units/kilogram.hpp
==============================================================================
--- sandbox/units/boost/units/systems/base_units/kilogram.hpp (original)
+++ sandbox/units/boost/units/systems/base_units/kilogram.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -2,7 +2,7 @@
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
-// Copyright (C) 2008 Steven Watanabe
+// 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
Modified: sandbox/units/boost/units/systems/base_units/meter.hpp
==============================================================================
--- sandbox/units/boost/units/systems/base_units/meter.hpp (original)
+++ sandbox/units/boost/units/systems/base_units/meter.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -2,7 +2,7 @@
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
-// Copyright (C) 2008 Steven Watanabe
+// 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
@@ -40,5 +40,7 @@
#endif
+#include <boost/units/systems/base_units/detail/conversions.hpp>
+
#endif // BOOST_UNITS_METER_BASE_UNIT_HPP
Modified: sandbox/units/boost/units/systems/base_units/mile.hpp
==============================================================================
--- sandbox/units/boost/units/systems/base_units/mile.hpp (original)
+++ sandbox/units/boost/units/systems/base_units/mile.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -2,7 +2,7 @@
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
-// Copyright (C) 2008 Steven Watanabe
+// 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
@@ -39,4 +39,6 @@
#endif
+#include <boost/units/systems/base_units/detail/conversions.hpp>
+
#endif // BOOST_UNITS_MILE_BASE_UNIT_HPP
Modified: sandbox/units/boost/units/systems/base_units/minute.hpp
==============================================================================
--- sandbox/units/boost/units/systems/base_units/minute.hpp (original)
+++ sandbox/units/boost/units/systems/base_units/minute.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -2,7 +2,7 @@
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
-// Copyright (C) 2008 Steven Watanabe
+// 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
@@ -39,4 +39,6 @@
#endif
+#include <boost/units/systems/base_units/detail/conversions.hpp>
+
#endif // BOOST_UNITS_MINUTE_BASE_UNIT_HPP
Modified: sandbox/units/boost/units/systems/base_units/mole.hpp
==============================================================================
--- sandbox/units/boost/units/systems/base_units/mole.hpp (original)
+++ sandbox/units/boost/units/systems/base_units/mole.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -2,7 +2,7 @@
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
-// Copyright (C) 2008 Steven Watanabe
+// 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
@@ -39,4 +39,6 @@
#endif
+#include <boost/units/systems/base_units/detail/conversions.hpp>
+
#endif // BOOST_UNITS_MOLE_BASE_UNIT_HPP
Modified: sandbox/units/boost/units/systems/base_units/radian.hpp
==============================================================================
--- sandbox/units/boost/units/systems/base_units/radian.hpp (original)
+++ sandbox/units/boost/units/systems/base_units/radian.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -2,7 +2,7 @@
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
-// Copyright (C) 2008 Steven Watanabe
+// 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
@@ -37,7 +37,8 @@
BOOST_TYPEOF_REGISTER_TYPE(boost::units::radian_base_unit)
-
#endif
+#include <boost/units/systems/base_units/detail/conversions.hpp>
+
#endif // BOOST_UNITS_RADIAN_BASE_UNIT_HPP
Modified: sandbox/units/boost/units/systems/base_units/revolution.hpp
==============================================================================
--- sandbox/units/boost/units/systems/base_units/revolution.hpp (original)
+++ sandbox/units/boost/units/systems/base_units/revolution.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -2,7 +2,7 @@
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
-// Copyright (C) 2008 Steven Watanabe
+// 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
@@ -39,4 +39,6 @@
#endif
+#include <boost/units/systems/base_units/detail/conversions.hpp>
+
#endif // BOOST_UNITS_REVOLUTION_BASE_UNIT_HPP
Modified: sandbox/units/boost/units/systems/base_units/second.hpp
==============================================================================
--- sandbox/units/boost/units/systems/base_units/second.hpp (original)
+++ sandbox/units/boost/units/systems/base_units/second.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -2,7 +2,7 @@
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
-// Copyright (C) 2008 Steven Watanabe
+// 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
@@ -39,4 +39,6 @@
#endif
+#include <boost/units/systems/base_units/detail/conversions.hpp>
+
#endif // BOOST_UNITS_SECOND_BASE_UNIT_HPP
Modified: sandbox/units/boost/units/systems/base_units/steradian.hpp
==============================================================================
--- sandbox/units/boost/units/systems/base_units/steradian.hpp (original)
+++ sandbox/units/boost/units/systems/base_units/steradian.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -2,7 +2,7 @@
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
-// Copyright (C) 2008 Steven Watanabe
+// 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
@@ -39,4 +39,6 @@
#endif
+#include <boost/units/systems/base_units/detail/conversions.hpp>
+
#endif // BOOST_UNITS_STERADIAN_BASE_UNIT_HPP
Modified: sandbox/units/boost/units/systems/base_units/yard.hpp
==============================================================================
--- sandbox/units/boost/units/systems/base_units/yard.hpp (original)
+++ sandbox/units/boost/units/systems/base_units/yard.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -2,7 +2,7 @@
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
-// Copyright (C) 2008 Steven Watanabe
+// 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
@@ -37,7 +37,8 @@
BOOST_TYPEOF_REGISTER_TYPE(boost::units::yard_base_unit)
-
#endif
+#include <boost/units/systems/base_units/detail/conversions.hpp>
+
#endif // BOOST_UNITS_YARD_BASE_UNIT_HPP
Modified: sandbox/units/boost/units/systems/metric/year.hpp
==============================================================================
--- sandbox/units/boost/units/systems/metric/year.hpp (original)
+++ sandbox/units/boost/units/systems/metric/year.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -27,7 +27,7 @@
}
template<>
-struct base_unit_info<metric::day_base_unit> {
+struct base_unit_info<metric::year_base_unit> {
static const char* name() { return("Julian year"); }
static const char* symbol() { return("year"); }
};
Modified: sandbox/units/boost/units/systems/survey/link.hpp
==============================================================================
--- sandbox/units/boost/units/systems/survey/link.hpp (original)
+++ sandbox/units/boost/units/systems/survey/link.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -14,6 +14,6 @@
#include <boost/units/systems/detail/non_si_unit.hpp>
#include <boost/units/systems/base_units/meter.hpp>
-BOOST_UNITS_NON_SI_UNIT(survey, link, link, 0.2011684, meter_base_unit, 24);
+BOOST_UNITS_NON_SI_UNIT(survey, link, "link", "link", 0.2011684, meter_base_unit, 24);
#endif
Modified: sandbox/units/boost/units/systems/us/minim.hpp
==============================================================================
--- sandbox/units/boost/units/systems/us/minim.hpp (original)
+++ sandbox/units/boost/units/systems/us/minim.hpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -14,7 +14,7 @@
#include <boost/units/systems/detail/non_si_unit.hpp>
#include <boost/units/systems/si/volume.hpp>
-BOOST_UNITS_NON_SI_UNIT(us, minim, minim, 6.161152e-8, SI::volume, 19);
+BOOST_UNITS_NON_SI_UNIT(us, minim, "minim", "minim", 6.161152e-8, SI::volume, 19);
//#include <boost/units/scaled_base_unit.hpp>
//#include <boost/units/static_rational.hpp>
Modified: sandbox/units/libs/units/test/Jamfile.v2
==============================================================================
--- sandbox/units/libs/units/test/Jamfile.v2 (original)
+++ sandbox/units/libs/units/test/Jamfile.v2 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -11,6 +11,13 @@
requirements <include>$(BOOST_ROOT) <include>../../.. <warnings>all
;
+check-conversion-dependencies = [ path.glob-tree ../../../boost/units/systems/base_units : *.hpp ] ;
+checklibs =
+ $(BOOST_ROOT)/libs/regex/build//boost_regex
+ $(BOOST_ROOT)/libs/filesystem/build//boost_filesystem
+ $(BOOST_ROOT)/libs/system/build//boost_system
+;
+
import testing ;
{
@@ -31,6 +38,7 @@
[ run test_cmath.cpp : : : : ]
[ run test_limits.cpp : : : : ]
[ run test_custom_unit.cpp : : : : ]
+# [ run check_conversion_defs.cpp $(checklibs) : : : <dependency>$(check-conversion-dependencies) : ]
[ compile-fail fail_implicit_conversion.cpp : : ]
[ compile-fail fail_quantity_construct.cpp : : ]
[ compile-fail fail_quantity_assign.cpp : : ]
Added: sandbox/units/libs/units/test/check_conversion_defs.cpp
==============================================================================
--- (empty file)
+++ sandbox/units/libs/units/test/check_conversion_defs.cpp 2008-05-15 20:52:00 EDT (Thu, 15 May 2008)
@@ -0,0 +1,159 @@
+// 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)
+
+#include <iterator>
+#include <string>
+#include <utility>
+#include <set>
+#include <map>
+#include <iostream>
+
+#include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
+#include <boost/regex.hpp>
+
+namespace filesystem = boost::filesystem;
+
+//struct stop {
+// stop() { char c; std::cin >> c; }
+//} stop_;
+
+boost::regex whitespace("\\s*");
+boost::regex blank_line("\\A(?://.*$|\\s)*");
+
+boost::regex include_guard("#ifndef (\\w+)\n#define \\1\n");
+boost::regex base_unit("(\\w*_base_unit)(?:;| :)");
+
+std::pair<std::string, std::string> get_base_unit_and_include_guard(const filesystem::path& path) {
+ filesystem::ifstream in(path);
+ std::string contents(std::istreambuf_iterator<char>(in.rdbuf()), std::istreambuf_iterator<char>());
+ in.close();
+ boost::smatch include_guard_match;
+ boost::regex_search(contents, include_guard_match, include_guard);
+ boost::smatch base_unit_match;
+ boost::regex_search(contents, base_unit_match, base_unit);
+ std::cout << "creating map entry: " << base_unit_match[1].str() << " -> "<< include_guard_match[1].str() << std::endl;
+ return(std::make_pair(base_unit_match[1].str(), include_guard_match[1].str()));
+}
+
+int main() {
+ std::cout << "In main" << std::endl;
+ std::map<std::string, std::string> include_guards;
+ for(filesystem::directory_iterator begin(filesystem::path("../../../boost/units/systems/base_units")), end; begin != end; ++begin) {
+ if(begin->status().type() == filesystem::regular_file) {
+ std::cout << "reading file: " << begin->path() << std::endl;
+ include_guards.insert(get_base_unit_and_include_guard(begin->path()));
+ }
+ }
+
+ std::cout << "reading conversions file" << std::endl;
+ filesystem::ifstream conversions_file(filesystem::path("../../../boost/units/systems/base_units/detail/conversions.hpp"));
+
+ std::string line;
+ int line_count = 0;
+
+ boost::smatch match;
+
+ std::set<std::string> conversion_guards;
+
+ try {
+
+boost::regex include_guard_regex("#if defined\\((\\w+)\\) && defined\\((\\w+)\\) &&\\\\");
+std::cout << __LINE__ << std::endl;
+boost::regex conversion_guard_regex(" !defined\\((\\w+)\\)");
+std::cout << __LINE__ << std::endl;
+boost::regex set_conversion_guard(" #define (\\w+)");
+std::cout << __LINE__ << std::endl;
+boost::regex include_conversion(" #include <boost/units/conversion.hpp>");
+std::cout << __LINE__ << std::endl;
+boost::regex include_absolute(" #include <boost/units/absolute.hpp>");
+std::cout << __LINE__ << std::endl;
+boost::regex define_conversion_factor(" BOOST_UNITS_DEFINE_CONVERSION_FACTOR\\(boost::units::(\\w+_base_unit), boost::units::(\\w+_base_unit), \\w+, (?:[\\d\\.e\\-/ ]*|one\\(\\))\\);");
+std::cout << __LINE__ << std::endl;
+boost::regex define_conversion_offset(" BOOST_UNITS_DEFINE_CONVERSION_OFFSET\\(boost::units::(\\w+_base_unit), boost::units::(\\w+_base_unit), \\w+, [\\d\\.e+\\* \\-/]*\\);");
+std::cout << __LINE__ << std::endl;
+boost::regex endif("#endif");
+std::cout << __LINE__ << std::endl;
+
+ while(std::getline(conversions_file, line)) {
+ ++line_count;
+ std::cout << "on line: " << line_count << std::endl;
+ if(boost::regex_match(line, match, blank_line)) {
+ continue;
+ } else if(boost::regex_match(line, match, include_guard_regex)) {
+ std::string guard1, guard2, unit1, unit2, conversion_guard;
+ bool uses_absolute = false;
+
+ guard1 = match[1].str();
+ guard2 = match[2].str();
+ if(!std::getline(conversions_file, line)) { std::cerr << "unexpected end of file." << std::endl; return(1); } ++line_count;
+ if(!boost::regex_match(line, match, conversion_guard_regex)) { std::cerr << "error on line: " << line_count << std::endl; return(1); }
+
+ conversion_guard = match[1].str();
+ if(!conversion_guards.insert(conversion_guard).second){ std::cerr << "error on line: " << line_count << std::endl; return(1); }
+
+ if(!std::getline(conversions_file, line)) { std::cerr << "unexpected end of file." << std::endl; return(1); } ++line_count;
+ if(!boost::regex_match(line, match, set_conversion_guard)) { std::cerr << "error on line: " << line_count << std::endl; return(1); }
+std::cout << __LINE__ << std::endl;
+
+ if(match[1].str() != conversion_guard) { std::cerr << "error on line: " << line_count << std::endl; return(1); }
+
+ if(!std::getline(conversions_file, line)) { std::cerr << "unexpected end of file." << std::endl; return(1); } ++line_count;
+ if(!boost::regex_match(line, match, include_conversion)) { std::cerr << "error on line: " << line_count << std::endl; return(1); }
+std::cout << __LINE__ << std::endl;
+
+ if(!std::getline(conversions_file, line)) { std::cerr << "unexpected end of file." << std::endl; return(1); } ++line_count;
+ if(boost::regex_match(line, match, include_absolute)) {
+ uses_absolute = true;
+ if(!std::getline(conversions_file, line)) { std::cerr << "unexpected end of file." << std::endl; return(1); } ++line_count;
+ }
+
+std::cout << __LINE__ << std::endl;
+ if(!boost::regex_match(line, match, define_conversion_factor)) { std::cerr << "error on line: " << line_count << std::endl; return(1); }
+
+std::cout << __LINE__ << ": " << line << std::endl;
+ unit1 = match[1].str();
+ unit2 = match[2].str();
+ if(!((include_guards[unit1] == guard1 && include_guards[unit2] == guard2) ||
+ (include_guards[unit1] == guard2 && include_guards[unit2] == guard1))) {
+ std::cerr << "guard1: " << guard1 << std::endl;
+ std::cerr << "guard2: " << guard2 << std::endl;
+ std::cerr << "unit1: " << unit1 << std::endl;
+ std::cerr << "unit2: " << unit2 << std::endl;
+ std::cerr << "include_guards[unit1]: " << include_guards[unit1] << std::endl;
+ std::cerr << "include_guards[unit2]: " << include_guards[unit2] << std::endl;
+ { std::cerr << "error on line: " << line_count << std::endl; return(1); }
+ }
+std::cout << __LINE__ << std::endl;
+
+ if(!std::getline(conversions_file, line)) { std::cerr << "unexpected end of file." << std::endl; return(1); } ++line_count;
+std::cout << __LINE__ << std::endl;
+ if(boost::regex_match(line, match, define_conversion_offset)) {
+ if(!uses_absolute) { std::cerr << "error on line: " << line_count << std::endl; return(1); }
+std::cout << __LINE__ << std::endl;
+ if(match[1].str() != unit1 || match[2].str() != unit2) { std::cerr << "error on line: " << line_count << std::endl; return(1); }
+ if(!std::getline(conversions_file, line)) { std::cerr << "unexpected end of file." << std::endl; return(1); } ++line_count;
+ } else {
+ if(uses_absolute) { std::cerr << "error on line: " << line_count << std::endl; return(1); }
+ }
+std::cout << __LINE__ << std::endl;
+
+
+ if(!boost::regex_match(line, match, endif)) { std::cerr << "error on line: " << line_count << std::endl; return(1); }
+
+ }
+ }
+
+ } catch(std::exception& e) {
+ std::cerr << e.what() << std::endl;
+ return(1);
+ }
+
+}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk