|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r53125 - in trunk: boost/units boost/units/detail libs/units/doc libs/units/example
From: steven_at_[hidden]
Date: 2009-05-19 20:55:44
Author: steven_watanabe
Date: 2009-05-19 20:55:43 EDT (Tue, 19 May 2009)
New Revision: 53125
URL: http://svn.boost.org/trac/boost/changeset/53125
Log:
Minor cleanup/doc tweaks
Text files modified:
trunk/boost/units/conversion.hpp | 6 +++++-
trunk/boost/units/detail/utility.hpp | 12 ------------
trunk/libs/units/doc/units.qbk | 13 ++++++++-----
trunk/libs/units/example/dimension.cpp | 7 ++-----
trunk/libs/units/example/kitchen_sink.cpp | 4 ----
5 files changed, 15 insertions(+), 27 deletions(-)
Modified: trunk/boost/units/conversion.hpp
==============================================================================
--- trunk/boost/units/conversion.hpp (original)
+++ trunk/boost/units/conversion.hpp 2009-05-19 20:55:43 EDT (Tue, 19 May 2009)
@@ -41,6 +41,10 @@
/// }
/// }
/// @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
{
@@ -54,7 +58,7 @@
/// 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.
+/// 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 { \
Modified: trunk/boost/units/detail/utility.hpp
==============================================================================
--- trunk/boost/units/detail/utility.hpp (original)
+++ trunk/boost/units/detail/utility.hpp 2009-05-19 20:55:43 EDT (Tue, 19 May 2009)
@@ -12,15 +12,9 @@
#define BOOST_UNITS_UTILITY_HPP
#include <cstdlib>
-#include <complex>
-#include <iostream>
#include <typeinfo>
#include <string>
-#include <boost/assert.hpp>
-#include <boost/cstdint.hpp>
-#include <boost/limits.hpp>
-
#if defined(__GLIBCXX__) || defined(__GLIBCPP__)
#define BOOST_UNITS_USE_DEMANGLING
#include <cxxabi.h>
@@ -53,13 +47,7 @@
std::free(realname);
- //boost::replace_all(out," ","");
boost::replace_all(out,"boost::units::","");
- //boost::replace_all(out,"static_rational","R");
- //boost::replace_all(out,"dimensionless_type","dl");
- //boost::replace_all(out,"_base_dimension","_bd");
- //boost::replace_all(out,"_base_unit","_bu");
- //boost::replace_all(out,"heterogeneous_system","hts");
return out;
}
Modified: trunk/libs/units/doc/units.qbk
==============================================================================
--- trunk/libs/units/doc/units.qbk (original)
+++ trunk/libs/units/doc/units.qbk 2009-05-19 20:55:43 EDT (Tue, 19 May 2009)
@@ -89,7 +89,9 @@
# Intel CC 9.1, 10.0, and 10.1 on Mac OSX 10.4
# g++ 3.4.4, 4.2.3, and 4.3.0 on Windows XP
# Microsoft Visual C++ 7.1, 8.0, and 9.0 on Windows XP
+# Comeau 4.3.10.1 beta2 on Windows XP
# Metrowerks CodeWarrior 9.2 on Windows XP.
+# Sun CC 5.9 on Solaris and Linux
The following compilers/platforms are known *not* to work :
@@ -97,6 +99,7 @@
# Microsoft Visual C++ 6.0 on Windows XP
# Microsoft Visual C++ 7.0 on Windows XP
# Metrowerks CodeWarrior 8.0 on Windows XP.
+# All versions of Borland.
[endsect]
@@ -249,11 +252,11 @@
[section:Units Units]
-We define a *unit* as a linear combination of base units. Thus, the SI unit corresponding
-to the dimension of force is kg m s^-2, where kg, m, and s are base units. We use the
-notion of a *unit system* such as SI to specify the mapping from a dimension to a
-particular unit so that instead of specifying the base units explicitly, we can just
-ask for the representation of a dimension in a particular system.
+We define a *unit* as a set of base units each of which can be raised to an arbitrary rational
+exponent. Thus, the SI unit corresponding to the dimension of force is kg m s^-2, where kg, m,
+and s are base units. We use the notion of a *unit system* such as SI to specify the mapping
+from a dimension to a particular unit so that instead of specifying the base units explicitly,
+we can just ask for the representation of a dimension in a particular system.
Units are, like dimensions, purely compile-time variables with no associated value.
Units obey the same algebra as dimensions do; the presence of the unit system serves to ensure that units having identical
Modified: trunk/libs/units/example/dimension.cpp
==============================================================================
--- trunk/libs/units/example/dimension.cpp (original)
+++ trunk/libs/units/example/dimension.cpp 2009-05-19 20:55:43 EDT (Tue, 19 May 2009)
@@ -32,14 +32,11 @@
@endverbatim
**/
-// undefine this if you don't want to demangle symbols
-// need to link with libboost_regex to get demangling functionality
-#define MCS_USE_DEMANGLING
-
#include <boost/type_traits/is_same.hpp>
-
#include <boost/mpl/assert.hpp>
+#include <iostream>
+
#include <boost/units/detail/utility.hpp>
#include "test_system.hpp"
Modified: trunk/libs/units/example/kitchen_sink.cpp
==============================================================================
--- trunk/libs/units/example/kitchen_sink.cpp (original)
+++ trunk/libs/units/example/kitchen_sink.cpp 2009-05-19 20:55:43 EDT (Tue, 19 May 2009)
@@ -218,12 +218,8 @@
{
using namespace boost::units::si;
- #if BOOST_UNITS_HAS_TYPEOF
using namespace constants::codata;
return (P*V/(R*T));
- #else
- return P*V/(8.314472*(joules/(kelvin*mole))*T);
- #endif // BOOST_UNITS_HAS_TYPEOF
}
//]
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