|
Boost-Commit : |
From: steven_watanabe_at_[hidden]
Date: 2007-05-28 15:01:31
Author: steven_watanabe
Date: 2007-05-28 15:01:30 EDT (Mon, 28 May 2007)
New Revision: 4335
URL: http://svn.boost.org/trac/boost/changeset/4335
Log:
Made gcc happy
Text files modified:
sandbox/units/boost/units/detail/cmath_mwcw_impl.hpp | 2
sandbox/units/boost/units/experimental/io.hpp | 2
sandbox/units/boost/units/systems/si/constants.hpp | 33 ++++++++++++++++--
sandbox/units/libs/units/example/scaled_value.hpp | 70 ++++++++++++++++++++--------------------
4 files changed, 65 insertions(+), 42 deletions(-)
Modified: sandbox/units/boost/units/detail/cmath_mwcw_impl.hpp
==============================================================================
--- sandbox/units/boost/units/detail/cmath_mwcw_impl.hpp (original)
+++ sandbox/units/boost/units/detail/cmath_mwcw_impl.hpp 2007-05-28 15:01:30 EDT (Mon, 28 May 2007)
@@ -215,4 +215,4 @@
#endif // __MWERKS__
-#endif // BOOST_UNITS_CMATH_MWCW_IMPL_HPP
\ No newline at end of file
+#endif // BOOST_UNITS_CMATH_MWCW_IMPL_HPP
Modified: sandbox/units/boost/units/experimental/io.hpp
==============================================================================
--- sandbox/units/boost/units/experimental/io.hpp (original)
+++ sandbox/units/boost/units/experimental/io.hpp 2007-05-28 15:01:30 EDT (Mon, 28 May 2007)
@@ -115,7 +115,7 @@
template<class Char, class Traits, class Dimension, class System>
std::basic_ostream<Char, Traits>& operator<<(std::basic_ostream<Char, Traits>& os, const unit<Dimension, System>&) {
- os << reduce_unit<unit<Dimension, System> >::type();
+ os << typename reduce_unit<unit<Dimension, System> >::type();
return(os);
}
Modified: sandbox/units/boost/units/systems/si/constants.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/constants.hpp (original)
+++ sandbox/units/boost/units/systems/si/constants.hpp 2007-05-28 15:01:30 EDT (Mon, 28 May 2007)
@@ -24,10 +24,24 @@
namespace units {
template<class Base>
-struct constant : Base {};
+struct constant {
+ typedef typename Base::value_type value_type;
+ operator value_type() const { return Base().value(); }
+ value_type value() const { return Base().value(); }
+ value_type uncertainty() const { return Base().uncertainty(); }
+ value_type lower_bound() const { return Base().lower_bound(); }
+ value_type upper_bound() const { return Base().upper_bound(); }
+};
template<class Base>
-struct physical_constant : Base {};
+struct physical_constant {
+ typedef typename Base::value_type value_type;
+ operator value_type() const { return Base().value(); }
+ value_type value() const { return Base().value(); }
+ value_type uncertainty() const { return Base().uncertainty(); }
+ value_type lower_bound() const { return Base().lower_bound(); }
+ value_type upper_bound() const { return Base().upper_bound(); }
+};
#define BOOST_UNITS_DEFINE_HELPER(name, symbol, template_name) \
\
@@ -125,12 +139,12 @@
value_type lower_bound() const { return value_-uncertainty_; } \
value_type upper_bound() const { return value_+uncertainty_; } \
}; \
-BOOST_UNITS_STATIC_CONSTANT(name, boost::units::constant<boost::units::physical_constant<name ## _t> >)
+BOOST_UNITS_STATIC_CONSTANT(name, boost::units::constant<boost::units::physical_constant<name ## _t> >) = {}
// stream output
-template<class Y>
+template<class Char, class Traits, class Y>
inline
-std::ostream& operator<<(std::ostream& os,const physical_constant<Y>& val)
+std::basic_ostream<Char, Traits>& operator<<(std::basic_ostream<Char, Traits>& os,const physical_constant<Y>& val)
{
boost::io::ios_precision_saver precision_saver(os);
//boost::io::ios_width_saver width_saver(os);
@@ -167,6 +181,15 @@
return os;
}
+// stream output
+template<class Char, class Traits, class Y>
+inline
+std::basic_ostream<Char, Traits>& operator<<(std::basic_ostream<Char, Traits>& os,const constant<Y>&)
+{
+ os << Y();
+ return os;
+}
+
} // namespace units
} // namespace boost
Modified: sandbox/units/libs/units/example/scaled_value.hpp
==============================================================================
--- sandbox/units/libs/units/example/scaled_value.hpp (original)
+++ sandbox/units/libs/units/example/scaled_value.hpp 2007-05-28 15:01:30 EDT (Mon, 28 May 2007)
@@ -175,7 +175,7 @@
else
{
// os << val.value() << " x " << val.base() << "^" << Exp;
- os << val.value()*scale<(Scale::base), remainder_exponent>::value() << " x " << reduced_scale::base << "^" << reduced_scale::exponent();
+ os << val.value()*scale<(Scale::base), remainder_exponent>::value() << " x " << reduced_scale::base << "^" << typename reduced_scale::exponent();
// os << val.value()*std::pow(Y(val.base()),Y(remainder_exponent)) << " " << getShortPrefix(reduced_scale());
}
@@ -271,7 +271,7 @@
operator*(const scaled_value< Y,scale<Base,Exp1> >& lhs,
const scaled_value< Y,scale<Base,Exp2> >& rhs)
{
- return scaled_value< Y,scale<Base,mpl::plus<Exp1,Exp2>::type> >(lhs.value()*rhs.value());
+ return scaled_value< Y,scale<Base,typename mpl::plus<Exp1,Exp2>::type> >(lhs.value()*rhs.value());
}
template<class Y,long Base,class Exp1,class Exp2>
@@ -323,19 +323,19 @@
} // namespace _
-BOOST_UNITS_STATIC_CONSTANT(kibi,_::scale_2_10);
-BOOST_UNITS_STATIC_CONSTANT(mebi,_::scale_2_20);
-BOOST_UNITS_STATIC_CONSTANT(gibi,_::scale_2_30);
-BOOST_UNITS_STATIC_CONSTANT(tebi,_::scale_2_40);
-BOOST_UNITS_STATIC_CONSTANT(pebi,_::scale_2_50);
-BOOST_UNITS_STATIC_CONSTANT(exbi,_::scale_2_60);
-
-BOOST_UNITS_STATIC_CONSTANT(Ki,_::scale_2_10);
-BOOST_UNITS_STATIC_CONSTANT(Mi,_::scale_2_20);
-BOOST_UNITS_STATIC_CONSTANT(Gi,_::scale_2_30);
-BOOST_UNITS_STATIC_CONSTANT(Ti,_::scale_2_40);
-BOOST_UNITS_STATIC_CONSTANT(Pi,_::scale_2_50);
-BOOST_UNITS_STATIC_CONSTANT(Ei,_::scale_2_60);
+BOOST_UNITS_STATIC_CONSTANT(kibi,_::scale_2_10) = {};
+BOOST_UNITS_STATIC_CONSTANT(mebi,_::scale_2_20) = {};
+BOOST_UNITS_STATIC_CONSTANT(gibi,_::scale_2_30) = {};
+BOOST_UNITS_STATIC_CONSTANT(tebi,_::scale_2_40) = {};
+BOOST_UNITS_STATIC_CONSTANT(pebi,_::scale_2_50) = {};
+BOOST_UNITS_STATIC_CONSTANT(exbi,_::scale_2_60) = {};
+
+BOOST_UNITS_STATIC_CONSTANT(Ki,_::scale_2_10) = {};
+BOOST_UNITS_STATIC_CONSTANT(Mi,_::scale_2_20) = {};
+BOOST_UNITS_STATIC_CONSTANT(Gi,_::scale_2_30) = {};
+BOOST_UNITS_STATIC_CONSTANT(Ti,_::scale_2_40) = {};
+BOOST_UNITS_STATIC_CONSTANT(Pi,_::scale_2_50) = {};
+BOOST_UNITS_STATIC_CONSTANT(Ei,_::scale_2_60) = {};
} // namespace IEEE_1541
@@ -366,26 +366,26 @@
} // namespace _
-BOOST_UNITS_STATIC_CONSTANT(yocto,_::scale_10_m24);
-BOOST_UNITS_STATIC_CONSTANT(zepto,_::scale_10_m21);
-BOOST_UNITS_STATIC_CONSTANT(atto,_::scale_10_m18);
-BOOST_UNITS_STATIC_CONSTANT(femto,_::scale_10_m15);
-BOOST_UNITS_STATIC_CONSTANT(pico,_::scale_10_m12);
-BOOST_UNITS_STATIC_CONSTANT(nano,_::scale_10_m9);
-BOOST_UNITS_STATIC_CONSTANT(micro,_::scale_10_m6);
-BOOST_UNITS_STATIC_CONSTANT(milli,_::scale_10_m3);
-BOOST_UNITS_STATIC_CONSTANT(centi,_::scale_10_m2);
-BOOST_UNITS_STATIC_CONSTANT(deci,_::scale_10_m1);
-BOOST_UNITS_STATIC_CONSTANT(deka,_::scale_10_1);
-BOOST_UNITS_STATIC_CONSTANT(hecto,_::scale_10_2);
-BOOST_UNITS_STATIC_CONSTANT(kilo,_::scale_10_3);
-BOOST_UNITS_STATIC_CONSTANT(mega,_::scale_10_6);
-BOOST_UNITS_STATIC_CONSTANT(giga,_::scale_10_9);
-BOOST_UNITS_STATIC_CONSTANT(tera,_::scale_10_12);
-BOOST_UNITS_STATIC_CONSTANT(peta,_::scale_10_15);
-BOOST_UNITS_STATIC_CONSTANT(exa,_::scale_10_18);
-BOOST_UNITS_STATIC_CONSTANT(zetta,_::scale_10_21);
-BOOST_UNITS_STATIC_CONSTANT(yotta,_::scale_10_24);
+BOOST_UNITS_STATIC_CONSTANT(yocto,_::scale_10_m24) = {};
+BOOST_UNITS_STATIC_CONSTANT(zepto,_::scale_10_m21) = {};
+BOOST_UNITS_STATIC_CONSTANT(atto,_::scale_10_m18) = {};
+BOOST_UNITS_STATIC_CONSTANT(femto,_::scale_10_m15) = {};
+BOOST_UNITS_STATIC_CONSTANT(pico,_::scale_10_m12) = {};
+BOOST_UNITS_STATIC_CONSTANT(nano,_::scale_10_m9) = {};
+BOOST_UNITS_STATIC_CONSTANT(micro,_::scale_10_m6) = {};
+BOOST_UNITS_STATIC_CONSTANT(milli,_::scale_10_m3) = {};
+BOOST_UNITS_STATIC_CONSTANT(centi,_::scale_10_m2) = {};
+BOOST_UNITS_STATIC_CONSTANT(deci,_::scale_10_m1) = {};
+BOOST_UNITS_STATIC_CONSTANT(deka,_::scale_10_1) = {};
+BOOST_UNITS_STATIC_CONSTANT(hecto,_::scale_10_2) = {};
+BOOST_UNITS_STATIC_CONSTANT(kilo,_::scale_10_3) = {};
+BOOST_UNITS_STATIC_CONSTANT(mega,_::scale_10_6) = {};
+BOOST_UNITS_STATIC_CONSTANT(giga,_::scale_10_9) = {};
+BOOST_UNITS_STATIC_CONSTANT(tera,_::scale_10_12) = {};
+BOOST_UNITS_STATIC_CONSTANT(peta,_::scale_10_15) = {};
+BOOST_UNITS_STATIC_CONSTANT(exa,_::scale_10_18) = {};
+BOOST_UNITS_STATIC_CONSTANT(zetta,_::scale_10_21) = {};
+BOOST_UNITS_STATIC_CONSTANT(yotta,_::scale_10_24) = {};
} // namespace metric
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