Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56618 - in branches/release: . boost/graph boost/numeric/ublas boost/program_options boost/python boost/regex boost/signals boost/signals2 boost/system boost/units boost/units/base_units/us boost/units/detail libs/fusion libs/graph_parallel libs/mpl/doc/refmanual libs/mpl/doc/src/refmanual libs/numeric/ublas libs/program_options libs/python libs/regex libs/signals libs/signals2 libs/system libs/timer libs/units/test status tools/build/v2 tools/regression
From: steven_at_[hidden]
Date: 2009-10-06 13:01:56


Author: steven_watanabe
Date: 2009-10-06 13:01:55 EDT (Tue, 06 Oct 2009)
New Revision: 56618
URL: http://svn.boost.org/trac/boost/changeset/56618

Log:
Merge units from the trunk.
Added:
   branches/release/boost/units/base_units/us/pound_force.hpp
      - copied unchanged from r56125, /trunk/boost/units/base_units/us/pound_force.hpp
Properties modified:
   branches/release/ (props changed)
   branches/release/boost/graph/ (props changed)
   branches/release/boost/numeric/ublas/ (props changed)
   branches/release/boost/program_options/ (props changed)
   branches/release/boost/python/ (props changed)
   branches/release/boost/regex/ (props changed)
   branches/release/boost/signals/ (props changed)
   branches/release/boost/signals2/ (props changed)
   branches/release/boost/system/ (props changed)
   branches/release/libs/fusion/ (props changed)
   branches/release/libs/graph_parallel/ (props changed)
   branches/release/libs/mpl/doc/refmanual/broken-compiler-workarounds.html (props changed)
   branches/release/libs/mpl/doc/refmanual/categorized-index-concepts.html (props changed)
   branches/release/libs/mpl/doc/refmanual/cfg-no-preprocessed-headers.html (props changed)
   branches/release/libs/mpl/doc/refmanual/composition-and-argument-binding.html (props changed)
   branches/release/libs/mpl/doc/refmanual/data-types-concepts.html (props changed)
   branches/release/libs/mpl/doc/refmanual/data-types-miscellaneous.html (props changed)
   branches/release/libs/mpl/doc/refmanual/extensible-associative-sequence.html (props changed)
   branches/release/libs/mpl/doc/refmanual/inserter-class.html (props changed)
   branches/release/libs/mpl/doc/refmanual/tag-dispatched-metafunction.html (props changed)
   branches/release/libs/mpl/doc/refmanual/trivial-metafunctions-summary.html (props changed)
   branches/release/libs/mpl/doc/src/refmanual/Iterators-Iterator.rst (props changed)
   branches/release/libs/numeric/ublas/ (props changed)
   branches/release/libs/program_options/ (props changed)
   branches/release/libs/python/ (props changed)
   branches/release/libs/regex/ (props changed)
   branches/release/libs/signals/ (props changed)
   branches/release/libs/signals2/ (props changed)
   branches/release/libs/system/ (props changed)
   branches/release/libs/timer/ (props changed)
   branches/release/status/ (props changed)
   branches/release/tools/build/v2/ (props changed)
   branches/release/tools/regression/ (props changed)
Text files modified:
   branches/release/boost/units/detail/heterogeneous_conversion.hpp | 2 +-
   branches/release/boost/units/scale.hpp | 6 ++++--
   branches/release/boost/units/scaled_base_unit.hpp | 7 +++++--
   branches/release/libs/units/test/test_output.cpp | 19 +++++++++++++++++++
   4 files changed, 29 insertions(+), 5 deletions(-)

Modified: branches/release/boost/units/detail/heterogeneous_conversion.hpp
==============================================================================
--- branches/release/boost/units/detail/heterogeneous_conversion.hpp (original)
+++ branches/release/boost/units/detail/heterogeneous_conversion.hpp 2009-10-06 13:01:55 EDT (Tue, 06 Oct 2009)
@@ -91,7 +91,7 @@
 struct make_solve_list_internal_zero {
     template<class Next, class X>
     struct apply {
- typedef solve_normal<X, T, Next> type;
+ typedef solve_normal<T, X, Next> type;
     };
 };
 

Modified: branches/release/boost/units/scale.hpp
==============================================================================
--- branches/release/boost/units/scale.hpp (original)
+++ branches/release/boost/units/scale.hpp 2009-10-06 13:01:55 EDT (Tue, 06 Oct 2009)
@@ -35,8 +35,10 @@
     typedef Exponent exponent;
     typedef double value_type;
     static value_type value() { return(detail::static_rational_power<Exponent>(static_cast<double>(base))); }
- static std::string name() { return ""; };
- static std::string symbol() { return ""; };
+ // These need to be defined in specializations for
+ // printing to work.
+ // static std::string name();
+ // static std::string symbol();
 };
 
 template<long Base, class Exponent>

Modified: branches/release/boost/units/scaled_base_unit.hpp
==============================================================================
--- branches/release/boost/units/scaled_base_unit.hpp (original)
+++ branches/release/boost/units/scaled_base_unit.hpp 2009-10-06 13:01:55 EDT (Tue, 06 Oct 2009)
@@ -37,6 +37,9 @@
 template<class T, class E>
 struct heterogeneous_system_dim;
 
+template<class T>
+struct base_unit_info;
+
 /// INTERNAL ONLY
 struct scaled_base_unit_tag {};
 
@@ -75,11 +78,11 @@
 
     static std::string symbol()
     {
- return(Scale::symbol() + S::symbol());
+ return(Scale::symbol() + base_unit_info<S>::symbol());
     }
     static std::string name()
     {
- return(Scale::name() + S::name());
+ return(Scale::name() + base_unit_info<S>::name());
     }
 };
 

Modified: branches/release/libs/units/test/test_output.cpp
==============================================================================
--- branches/release/libs/units/test/test_output.cpp (original)
+++ branches/release/libs/units/test/test_output.cpp 2009-10-06 13:01:55 EDT (Tue, 06 Oct 2009)
@@ -69,6 +69,19 @@
 
 typedef boost::units::make_scaled_unit<scaled_length, boost::units::scale<2, boost::units::static_rational<10> > >::type double_scaled_length;
 
+typedef boost::units::scaled_base_unit<meter_base_unit, boost::units::scale<100, boost::units::static_rational<1> > > scaled_length_base_unit;
+namespace boost {
+namespace units {
+template<>
+struct base_unit_info<scaled_length_base_unit> {
+ static const char* symbol() { return("scm"); }
+ static const char* name() { return("scaled_meter"); }
+};
+}
+}
+typedef boost::units::scaled_base_unit<scaled_length_base_unit, boost::units::scale<10, boost::units::static_rational<3> > > double_scaled_length_base_unit;
+typedef double_scaled_length_base_unit::unit_type double_scaled_length2;
+
 typedef boost::units::reduce_unit<boost::units::unit<boost::units::volume_dimension, my_system> >::type custom1;
 
 std::string name_string(const custom1&) { return("custom1"); }
@@ -119,6 +132,7 @@
     BOOST_UNITS_TEST_OUTPUT(area(), "m^2");
     BOOST_UNITS_TEST_OUTPUT(scaled_area(), "k(m^2)");
     BOOST_UNITS_TEST_OUTPUT(double_scaled_length(), "Kikm");
+ BOOST_UNITS_TEST_OUTPUT(double_scaled_length2(), "kscm");
     BOOST_UNITS_TEST_OUTPUT(custom1(), "c1");
     BOOST_UNITS_TEST_OUTPUT(custom2(), "c2");
     BOOST_UNITS_TEST_OUTPUT(scaled_custom1(), "kc1");
@@ -139,6 +153,7 @@
     BOOST_UNITS_TEST_OUTPUT(area(), "m^2");
     BOOST_UNITS_TEST_OUTPUT(scaled_area(), "k(m^2)");
     BOOST_UNITS_TEST_OUTPUT(double_scaled_length(), "Kikm");
+ BOOST_UNITS_TEST_OUTPUT(double_scaled_length2(), "kscm");
     // when using raw format, we ignore the user defined overloads
     BOOST_UNITS_TEST_OUTPUT(custom1(), "m^3");
     BOOST_UNITS_TEST_OUTPUT(custom2(), "m s^-2");
@@ -160,6 +175,7 @@
     BOOST_UNITS_TEST_OUTPUT(area(), "meter^2");
     BOOST_UNITS_TEST_OUTPUT(scaled_area(), "kilo(meter^2)");
     BOOST_UNITS_TEST_OUTPUT(double_scaled_length(), "kibikilometer");
+ BOOST_UNITS_TEST_OUTPUT(double_scaled_length2(), "kiloscaled_meter");
     BOOST_UNITS_TEST_OUTPUT(custom1(), "custom1");
     BOOST_UNITS_TEST_OUTPUT(custom2(), "custom2");
     BOOST_UNITS_TEST_OUTPUT(scaled_custom1(), "kilocustom1");
@@ -181,6 +197,7 @@
     BOOST_UNITS_TEST_OUTPUT(1.5*area(), "1.5 m^2");
     BOOST_UNITS_TEST_OUTPUT(1.5*scaled_area(), "1.5 k(m^2)");
     BOOST_UNITS_TEST_OUTPUT(1.5*double_scaled_length(), "1.5 Kikm");
+ BOOST_UNITS_TEST_OUTPUT(1.5*double_scaled_length2(), "1.5 kscm");
     BOOST_UNITS_TEST_OUTPUT(1.5*custom1(), "1.5 c1");
     BOOST_UNITS_TEST_OUTPUT(1.5*custom2(), "1.5 c2");
     BOOST_UNITS_TEST_OUTPUT(1.5*scaled_custom1(), "1.5 kc1");
@@ -201,6 +218,7 @@
     BOOST_UNITS_TEST_OUTPUT(1.5*area(), "1.5 m^2");
     BOOST_UNITS_TEST_OUTPUT(1.5*scaled_area(), "1.5 k(m^2)");
     BOOST_UNITS_TEST_OUTPUT(1.5*double_scaled_length(), "1.5 Kikm");
+ BOOST_UNITS_TEST_OUTPUT(1.5*double_scaled_length2(), "1.5 kscm");
     // when using raw format, we ignore the user defined overloads
     BOOST_UNITS_TEST_OUTPUT(1.5*custom1(), "1.5 m^3");
     BOOST_UNITS_TEST_OUTPUT(1.5*custom2(), "1.5 m s^-2");
@@ -222,6 +240,7 @@
     BOOST_UNITS_TEST_OUTPUT(1.5*area(), "1.5 meter^2");
     BOOST_UNITS_TEST_OUTPUT(1.5*scaled_area(), "1.5 kilo(meter^2)");
     BOOST_UNITS_TEST_OUTPUT(1.5*double_scaled_length(), "1.5 kibikilometer");
+ BOOST_UNITS_TEST_OUTPUT(1.5*double_scaled_length2(), "1.5 kiloscaled_meter");
     BOOST_UNITS_TEST_OUTPUT(1.5*custom1(), "1.5 custom1");
     BOOST_UNITS_TEST_OUTPUT(1.5*custom2(), "1.5 custom2");
     BOOST_UNITS_TEST_OUTPUT(1.5*scaled_custom1(), "1.5 kilocustom1");


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