Boost logo

Boost-Commit :

From: steven_at_[hidden]
Date: 2008-06-04 22:54:02


Author: steven_watanabe
Date: 2008-06-04 22:54:01 EDT (Wed, 04 Jun 2008)
New Revision: 46151
URL: http://svn.boost.org/trac/boost/changeset/46151

Log:
Removed is_implicitly_convertible
Text files modified:
   sandbox/units/boost/units/unit.hpp | 1 +
   sandbox/units/libs/units/doc/units.qbk | 6 ------
   sandbox/units/libs/units/example/non_base_dimension.cpp | 19 ++-----------------
   sandbox/units/libs/units/example/temperature.cpp | 18 ------------------
   sandbox/units/libs/units/test/test_implicit_conversion.cpp | 2 --
   5 files changed, 3 insertions(+), 43 deletions(-)

Modified: sandbox/units/boost/units/unit.hpp
==============================================================================
--- sandbox/units/boost/units/unit.hpp (original)
+++ sandbox/units/boost/units/unit.hpp 2008-06-04 22:54:01 EDT (Wed, 04 Jun 2008)
@@ -81,6 +81,7 @@
> type;
 };
 
+/// INTERNAL ONLY
 template<class S1,class S2>
 struct is_implicitly_convertible :
     boost::is_same<typename reduce_unit<S1>::type, typename reduce_unit<S2>::type>

Modified: sandbox/units/libs/units/doc/units.qbk
==============================================================================
--- sandbox/units/libs/units/doc/units.qbk (original)
+++ sandbox/units/libs/units/doc/units.qbk 2008-06-04 22:54:01 EDT (Wed, 04 Jun 2008)
@@ -436,8 +436,6 @@
 If these conversions have been defined, then converting between
 scaled forms of these units will also automatically work.
 
-*** insert discussion of `is_implicitly_convertible` ***
-
 The macro [___BOOST_UNITS_DEFAULT_CONVERSION] specifies a conversion
 that will be applied to a base unit when no direct conversion is
 possible. This can be used to make arbitrary conversions work
@@ -476,8 +474,6 @@
     and if `Y` and `Z` are implicitly convertible.
 * implicit conversion between `quantity<Unit1,Y>` and `quantity<Unit2,Z>` is allowed if `Unit1`
     reduces to exactly the same combination of base units as `Unit2` and if `Y` and `Z` are convertible.
-* implicit conversion between `quantity<Unit1,Y>` and `quantity<Unit2,Z>` is allowed if
- `is_implicitly_convertible<Unit1,Unit2>` is true, *** `Unit1` and `Unit2` are dimensionally consistent ***, and `Y` and `Z` are convertible.
 * assignment between `quantity<Unit1,Y>` and `quantity<Unit2,Z>` is allowed under the same
   conditions as implicit conversion.
 * `quantity<Unit,Y>` can be directly constructed from a value of type `Y` using the static member function [___from_value]. Doing so,
@@ -1044,8 +1040,6 @@
     template<class Dim,class System> struct is_unit< unit<Dim,System> >;
     template<class Dim,class System> struct is_unit_of_system< unit<Dim,System>,System >;
     template<class Dim,class System> struct is_unit_of_dimension< unit<Dim,System>,Dim >;
- template<class Tag,class System1,class System2> struct base_unit_is_implicitly_convertible;
- template<class S1,class D1,class S2,class D2> struct is_implicitly_convertible< unit<D1,S1>,unit<D2,S2> >;
 
     template<class Unit,class Y> struct is_quantity< quantity<Unit,Y> >;
     template<class Dim,class System,class Y> struct is_quantity_of_system< quantity<unit<Dim,System>,Y>,System >;

Modified: sandbox/units/libs/units/example/non_base_dimension.cpp
==============================================================================
--- sandbox/units/libs/units/example/non_base_dimension.cpp (original)
+++ sandbox/units/libs/units/example/non_base_dimension.cpp 2008-06-04 22:54:01 EDT (Wed, 04 Jun 2008)
@@ -56,18 +56,6 @@
 
 //]
 
-template<>
-struct is_implicitly_convertible<unit<volume_dimension,imperial>,
- unit<volume_dimension,us> > :
- public mpl::true_
-{ };
-
-template<>
-struct is_implicitly_convertible<unit<volume_dimension,us>,
- unit<volume_dimension,imperial> > :
- public mpl::true_
-{ };
-
 } // namespace units
 
 } // namespace boost
@@ -83,11 +71,8 @@
     quantity<imperial_gallon> ig1(1.0*imperial_gallon());
     quantity<us_gallon> ug1(1.0*us_gallon());
     
- quantity<imperial_gallon> ig2;
- quantity<us_gallon> ug2;
-
- ig2 = ug1;
- ug2 = ig1;
+ quantity<imperial_gallon> ig2(ug1);
+ quantity<us_gallon> ug2(ig1);
     
     return 0;
 }

Modified: sandbox/units/libs/units/example/temperature.cpp
==============================================================================
--- sandbox/units/libs/units/example/temperature.cpp (original)
+++ sandbox/units/libs/units/example/temperature.cpp 2008-06-04 22:54:01 EDT (Wed, 04 Jun 2008)
@@ -24,11 +24,9 @@
 { 32 } °F
 { 273.15 } K
 { 273.15 } K
-{ 273.15 } K
 [ 32 ] °F
 [ 17.7778 ] K
 [ 17.7778 ] K
-[ 17.7778 ] K
 //]
 
 @endverbatim
@@ -65,18 +63,6 @@
 
 } // fahrenheit
 
-//[temperature_snippet_2
-template<>
-struct is_implicitly_convertible<
- fahrenheit::temperature,
- si::temperature > : public mpl::true_ { };
-
-template<>
-struct is_implicitly_convertible<
- absolute<fahrenheit::temperature>,
- absolute<si::temperature> > : public mpl::true_ { };
-//]
-
 } // namespace units
 
 } // namespace boost
@@ -90,9 +76,7 @@
         32.0*fahrenheit::degrees);
     
     quantity<absolute<si::temperature> > T2p(T1p);
- quantity<absolute<si::temperature> > T3p = T1p;
     quantity<si::temperature> T2v(T1v);
- quantity<si::temperature> T3v = T1v;
     //]
 
     typedef conversion_helper<
@@ -105,11 +89,9 @@
     std::cout << T1p << std::endl
               << absolute_conv_type::convert(T1p) << std::endl
               << T2p << std::endl
- << T3p << std::endl
               << T1v << std::endl
               << relative_conv_type::convert(T1v) << std::endl
               << T2v << std::endl
- << T3v << std::endl
               << std::endl;
 
     return 0;

Modified: sandbox/units/libs/units/test/test_implicit_conversion.cpp
==============================================================================
--- sandbox/units/libs/units/test/test_implicit_conversion.cpp (original)
+++ sandbox/units/libs/units/test/test_implicit_conversion.cpp 2008-06-04 22:54:01 EDT (Wed, 04 Jun 2008)
@@ -27,8 +27,6 @@
 #include <boost/units/quantity.hpp>
 #include <boost/units/systems/si.hpp>
 #include <boost/units/systems/cgs.hpp>
-//#include <boost/units/systems/conversions/convert_si_to_cgs.hpp>
-//#include <boost/units/systems/conversions/convert_cgs_to_si.hpp>
 
 namespace bu = boost::units;
 


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