Boost logo

Boost-Commit :

From: steven_watanabe_at_[hidden]
Date: 2007-05-30 19:12:52


Author: steven_watanabe
Date: 2007-05-30 19:12:51 EDT (Wed, 30 May 2007)
New Revision: 4371
URL: http://svn.boost.org/trac/boost/changeset/4371

Log:
Obliterate ordinal

Removed:
   sandbox/units/boost/units/ordinal.hpp
Text files modified:
   sandbox/units/boost/units/base_unit.hpp | 2 ++
   sandbox/units/boost/units/systems/cgs/base.hpp | 1 -
   sandbox/units/boost/units/systems/si/base.hpp | 1 -
   sandbox/units/libs/units/example/test_system.hpp | 1 -
   sandbox/units/libs/units/example/unit_example_21.cpp | 39 ---------------------------------------
   sandbox/units/libs/units/test/fail_quantity_add_assign.cpp | 4 ++--
   sandbox/units/libs/units/test/fail_quantity_subtract_assign.cpp | 4 ++--
   sandbox/units/libs/units/test/test_header.hpp | 1 -
   sandbox/units/libs/units/test/test_predicates.cpp | 12 ++++++++----
   9 files changed, 14 insertions(+), 51 deletions(-)

Modified: sandbox/units/boost/units/base_unit.hpp
==============================================================================
--- sandbox/units/boost/units/base_unit.hpp (original)
+++ sandbox/units/boost/units/base_unit.hpp 2007-05-30 19:12:51 EDT (Wed, 30 May 2007)
@@ -14,8 +14,10 @@
 #include <boost/units/config.hpp>
 #include <boost/units/dim.hpp>
 #include <boost/units/dimension_list.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/prevent_ordinal_redefinition_impl.hpp>
 

Deleted: sandbox/units/boost/units/ordinal.hpp
==============================================================================
--- sandbox/units/boost/units/ordinal.hpp 2007-05-30 19:12:51 EDT (Wed, 30 May 2007)
+++ (empty file)
@@ -1,37 +0,0 @@
-// mcs::units - A C++ library for zero-overhead dimensional analysis and
-// unit/quantity manipulation and conversion
-//
-// Copyright (C) 2003-2007 Matthias Christian Schabel
-// Copyright (C) 2007 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_ORDINAL_HPP
-#define BOOST_UNITS_ORDINAL_HPP
-
-#include <boost/mpl/long.hpp>
-
-#include <boost/units/config.hpp>
-
-namespace boost {
-
-namespace units {
-
-/// Class for defining a cardinal ordering of tags to faciliate compile-time sorting.
-template<long N> struct ordinal : mpl::long_<N> {};
-
-} // namespace units
-
-} // namespace boost
-
-#if BOOST_UNITS_HAS_BOOST_TYPEOF
-
-#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-
-BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::ordinal, (long))
-
-#endif
-
-#endif // BOOST_UNITS_ORDINAL_HPP

Modified: sandbox/units/boost/units/systems/cgs/base.hpp
==============================================================================
--- sandbox/units/boost/units/systems/cgs/base.hpp (original)
+++ sandbox/units/boost/units/systems/cgs/base.hpp 2007-05-30 19:12:51 EDT (Wed, 30 May 2007)
@@ -14,7 +14,6 @@
 #include <string>
 
 #include <boost/units/io.hpp>
-#include <boost/units/ordinal.hpp>
 #include <boost/units/static_constant.hpp>
 #include <boost/units/unit.hpp>
 #include <boost/units/make_system.hpp>

Modified: sandbox/units/boost/units/systems/si/base.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/base.hpp (original)
+++ sandbox/units/boost/units/systems/si/base.hpp 2007-05-30 19:12:51 EDT (Wed, 30 May 2007)
@@ -14,7 +14,6 @@
 #include <string>
 
 #include <boost/units/io.hpp>
-#include <boost/units/ordinal.hpp>
 #include <boost/units/static_constant.hpp>
 #include <boost/units/unit.hpp>
 #include <boost/units/make_system.hpp>

Modified: sandbox/units/libs/units/example/test_system.hpp
==============================================================================
--- sandbox/units/libs/units/example/test_system.hpp (original)
+++ sandbox/units/libs/units/example/test_system.hpp 2007-05-30 19:12:51 EDT (Wed, 30 May 2007)
@@ -16,7 +16,6 @@
 #include <boost/units/base_dimension.hpp>
 #include <boost/units/derived_dimension.hpp>
 #include <boost/units/io.hpp>
-#include <boost/units/ordinal.hpp>
 #include <boost/units/quantity.hpp>
 #include <boost/units/static_constant.hpp>
 #include <boost/units/unit.hpp>

Modified: sandbox/units/libs/units/example/unit_example_21.cpp
==============================================================================
--- sandbox/units/libs/units/example/unit_example_21.cpp (original)
+++ sandbox/units/libs/units/example/unit_example_21.cpp 2007-05-30 19:12:51 EDT (Wed, 30 May 2007)
@@ -29,7 +29,6 @@
 
 #include <boost/units/io.hpp>
 #include <boost/units/conversion.hpp>
-#include <boost/units/ordinal.hpp>
 #include <boost/units/unit.hpp>
 #include <boost/units/quantity.hpp>
 #include <boost/units/systems/physical_units.hpp>
@@ -40,8 +39,6 @@
 
 namespace units {
 
-//struct imperial : public ordinal<1000> { };
-
 struct imperial_gallon_tag : base_unit<imperial_gallon_tag, volume_type, 1> {};
 
 typedef make_system<imperial_gallon_tag>::type imperial;
@@ -50,46 +47,10 @@
 
 struct us_gallon_tag : base_unit<us_gallon_tag, volume_type, 2> {};
 
-//struct us : public ordinal<1001> { };
-
 typedef make_system<us_gallon_tag>::type us;
 
 typedef unit<volume_type,us> us_gallon;
 
-///// convert imperial gallons to us gallons
-//template<class Y>
-//class conversion_helper< quantity<unit<volume_type,imperial>,Y>,
-// quantity<unit<volume_type,us>,Y> >
-//{
-// public:
-// typedef quantity<unit<volume_type,imperial>,Y> from_quantity_type;
-// typedef quantity<unit<volume_type,us>,Y> to_quantity_type;
-//
-// static
-// to_quantity_type
-// convert(const from_quantity_type& source)
-// {
-// return to_quantity_type::from_value(source.value()*1.2009499255);
-// }
-//};
-//
-///// convert us gallons to imperial gallons
-//template<class Y>
-//class conversion_helper< quantity<unit<volume_type,us>,Y>,
-// quantity<unit<volume_type,imperial>,Y> >
-//{
-// public:
-// typedef quantity<unit<volume_type,us>,Y> from_quantity_type;
-// typedef quantity<unit<volume_type,imperial>,Y> to_quantity_type;
-//
-// static
-// to_quantity_type
-// convert(const from_quantity_type& source)
-// {
-// return to_quantity_type::from_value(source.value()/1.2009499255);
-// }
-//};
-
 template<>
 struct is_implicitly_convertible<unit<volume_type,imperial>,
                                  unit<volume_type,us> > :

Modified: sandbox/units/libs/units/test/fail_quantity_add_assign.cpp
==============================================================================
--- sandbox/units/libs/units/test/fail_quantity_add_assign.cpp (original)
+++ sandbox/units/libs/units/test/fail_quantity_add_assign.cpp 2007-05-30 19:12:51 EDT (Wed, 30 May 2007)
@@ -26,10 +26,10 @@
 
 namespace bu = boost::units;
 
-int main(int argc,char *argv[])
+int main(int,char *[])
 {
 
- const bu::quantity<bu::SI::length> T1;
+ bu::quantity<bu::SI::length> T1;
     T1 += 2.0 * bu::SI::seconds;
 
     return 0;

Modified: sandbox/units/libs/units/test/fail_quantity_subtract_assign.cpp
==============================================================================
--- sandbox/units/libs/units/test/fail_quantity_subtract_assign.cpp (original)
+++ sandbox/units/libs/units/test/fail_quantity_subtract_assign.cpp 2007-05-30 19:12:51 EDT (Wed, 30 May 2007)
@@ -26,10 +26,10 @@
 
 namespace bu = boost::units;
 
-int main(int argc,char *argv[])
+int main(int,char *[])
 {
 
- const bu::quantity<bu::SI::length> T1;
+ bu::quantity<bu::SI::length> T1;
     T1 -= 2.0 * bu::SI::seconds;
 
     return 0;

Modified: sandbox/units/libs/units/test/test_header.hpp
==============================================================================
--- sandbox/units/libs/units/test/test_header.hpp (original)
+++ sandbox/units/libs/units/test/test_header.hpp 2007-05-30 19:12:51 EDT (Wed, 30 May 2007)
@@ -26,7 +26,6 @@
 
 #include <boost/test/minimal.hpp>
 
-#include <boost/units/ordinal.hpp>
 #include <boost/units/base_dimension.hpp>
 #include <boost/units/derived_dimension.hpp>
 #include <boost/units/static_constant.hpp>

Modified: sandbox/units/libs/units/test/test_predicates.cpp
==============================================================================
--- sandbox/units/libs/units/test/test_predicates.cpp (original)
+++ sandbox/units/libs/units/test/test_predicates.cpp 2007-05-30 19:12:51 EDT (Wed, 30 May 2007)
@@ -25,6 +25,7 @@
 #include <boost/mpl/list/list0.hpp>
 
 #include <boost/units/base_dimension.hpp>
+#include <boost/units/base_unit.hpp>
 #include <boost/units/dimension.hpp>
 #include <boost/units/is_dimension_list.hpp>
 #include <boost/units/is_quantity.hpp>
@@ -33,7 +34,7 @@
 #include <boost/units/is_unit.hpp>
 #include <boost/units/is_unit_of_dimension.hpp>
 #include <boost/units/is_unit_of_system.hpp>
-#include <boost/units/ordinal.hpp>
+#include <boost/units/make_system.hpp>
 #include <boost/units/quantity.hpp>
 #include <boost/units/unit.hpp>
 
@@ -41,11 +42,14 @@
 
 struct dimension_tag : boost::units::base_dimension<dimension_tag,0> { };
 
-struct system1 : bu::ordinal<100> {};
-struct system2 : bu::ordinal<101> {};
-
 typedef dimension_tag::type dimension;
 
+struct base_unit1 : bu::base_unit<base_unit1, dimension, 100> {};
+struct base_unit2 : bu::base_unit<base_unit2, dimension, 101> {};
+
+typedef bu::make_system<base_unit1>::type system1;
+typedef bu::make_system<base_unit2>::type system2;
+
 int main(int,char *[])
 {
     BOOST_MPL_ASSERT((bu::is_dimension_list<bu::dimensionless_type>));


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