Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75177 - in trunk/boost: chrono/detail ratio ratio/detail
From: vicente.botet_at_[hidden]
Date: 2011-10-30 09:59:23


Author: viboes
Date: 2011-10-30 09:59:22 EDT (Sun, 30 Oct 2011)
New Revision: 75177
URL: http://svn.boost.org/trac/boost/changeset/75177

Log:
Ratio/Chrono Fix issue with overflow while seen if is_evenly_divisible_by
Text files modified:
   trunk/boost/chrono/detail/is_evenly_divisible_by.hpp | 21 --
   trunk/boost/ratio/detail/overflow_helpers.hpp | 11 +
   trunk/boost/ratio/ratio_io.hpp | 252 +++++++++++++++++++++++++++++++++++++++
   3 files changed, 268 insertions(+), 16 deletions(-)

Modified: trunk/boost/chrono/detail/is_evenly_divisible_by.hpp
==============================================================================
--- trunk/boost/chrono/detail/is_evenly_divisible_by.hpp (original)
+++ trunk/boost/chrono/detail/is_evenly_divisible_by.hpp 2011-10-30 09:59:22 EDT (Sun, 30 Oct 2011)
@@ -11,28 +11,19 @@
 #include <boost/chrono/config.hpp>
 
 #include <boost/mpl/logical.hpp>
-#include <boost/ratio/ratio.hpp>
-
+#include <boost/ratio/detail/overflow_helpers.hpp>
 
 namespace boost {
 namespace chrono {
 namespace chrono_detail {
 
-#if 1
- template <class R1, class R2>
- struct is_evenly_divisible_by : public boost::mpl::bool_ < ratio_divide<R1, R2>::type::den == 1 >
- {};
-#else
- template <class R1, class R2, bool C1>
- struct is_evenly_divisible_by2 : public boost::mpl::bool_ < ratio_divide<R1, R2>::type::den == 1 >
- {};
+// template <class R1, class R2>
+// struct is_evenly_divisible_by : public boost::mpl::bool_ < ratio_divide<R1, R2>::type::den == 1 >
+// {};
   template <class R1, class R2>
- struct is_evenly_divisible_by2<R1,R2,true> : public boost::mpl::bool_ < false >
+ struct is_evenly_divisible_by : public boost::ratio_detail::is_evenly_divisible_by<R1, R2>
   {};
- template <class R1, class R2>
- struct is_evenly_divisible_by : public is_evenly_divisible_by2<R1, R2, (R1::num < R1::den && R2::den < R2::num) || (R1::den < R1::num && R2::num < R2::den)>
- {};
-#endif
+
 } // namespace chrono_detail
 } // namespace detail
 } // namespace chrono

Modified: trunk/boost/ratio/detail/overflow_helpers.hpp
==============================================================================
--- trunk/boost/ratio/detail/overflow_helpers.hpp (original)
+++ trunk/boost/ratio/detail/overflow_helpers.hpp 2011-10-30 09:59:22 EDT (Sun, 30 Oct 2011)
@@ -311,6 +311,17 @@
              boost::ratio_detail::br_mul<R2::num / gcd_n1_n2, R1::den / gcd_d1_d2>::value
>::type type;
   };
+ template <class R1, class R2>
+ struct is_evenly_divisible_by
+ {
+ private:
+ static const boost::intmax_t gcd_n1_n2 = mpl::gcd_c<boost::intmax_t, R1::num, R2::num>::value;
+ static const boost::intmax_t gcd_d1_d2 = mpl::gcd_c<boost::intmax_t, R1::den, R2::den>::value;
+ public:
+ typedef integral_constant<bool,
+ ((R2::num / gcd_n1_n2 ==1) && (R1::den / gcd_d1_d2)==1)
+ > type;
+ };
   
   template <class T>
   struct is_ratio : public boost::false_type

Modified: trunk/boost/ratio/ratio_io.hpp
==============================================================================
--- trunk/boost/ratio/ratio_io.hpp (original)
+++ trunk/boost/ratio/ratio_io.hpp 2011-10-30 09:59:22 EDT (Sun, 30 Oct 2011)
@@ -35,6 +35,7 @@
 
 #include <boost/config.hpp>
 #include <boost/ratio/ratio.hpp>
+#include <boost/type_traits/integral_constant.hpp>
 #include <string>
 #include <sstream>
 
@@ -51,11 +52,18 @@
 
 namespace boost {
 
+template <class Ratio>
+struct ratio_string_is_localizable : false_type {};
+template <class Ratio>
+struct ratio_string_id : integral_constant<int,0> {};
+
 template <class Ratio, class CharT>
 struct ratio_string
 {
     static std::basic_string<CharT> short_name() {return long_name();}
     static std::basic_string<CharT> long_name();
+ static std::basic_string<CharT> symbol() {return short_name();}
+ static std::basic_string<CharT> prefix() {return long_name();}
 };
 
 template <class Ratio, class CharT>
@@ -67,6 +75,7 @@
                         << Ratio::den << CharT(']');
     return os.str();
 }
+
 #ifdef BOOST_RATIO_HAS_STATIC_STRING
 namespace ratio_detail {
 template <class Ratio, class CharT>
@@ -84,10 +93,18 @@
                     typename ratio_static_string<Ratio, CharT>::long_name
>::value);
     }
+ static std::basic_string<CharT> symbol() {return short_name();}
+ static std::basic_string<CharT> prefix() {return long_name();}
 };
 }
 #endif
 // atto
+template <>
+struct ratio_string_is_localizable<atto> : true_type {};
+
+template <>
+struct ratio_string_id<atto> : integral_constant<int,-18> {};
+
 #ifdef BOOST_RATIO_HAS_STATIC_STRING
 template <typename CharT>
 struct ratio_string<atto, CharT> :
@@ -100,6 +117,8 @@
 {
     static std::string short_name() {return std::string(1, 'a');}
     static std::string long_name() {return std::string("atto");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -109,6 +128,8 @@
 {
     static std::u16string short_name() {return std::u16string(1, u'a');}
     static std::u16string long_name() {return std::u16string(u"atto");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
 };
 
 template <>
@@ -116,6 +137,8 @@
 {
     static std::u32string short_name() {return std::u32string(1, U'a');}
     static std::u32string long_name() {return std::u32string(U"atto");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
 };
 
 #endif
@@ -126,12 +149,20 @@
 {
     static std::wstring short_name() {return std::wstring(1, L'a');}
     static std::wstring long_name() {return std::wstring(L"atto");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
 };
 #endif
 #endif
 
 // femto
 
+template <>
+struct ratio_string_is_localizable<femto> : true_type {};
+
+template <>
+struct ratio_string_id<femto> : integral_constant<int,-15> {};
+
 #ifdef BOOST_RATIO_HAS_STATIC_STRING
 template <typename CharT>
 struct ratio_string<femto, CharT> :
@@ -139,11 +170,14 @@
 {};
 
 #else
+
 template <>
 struct ratio_string<femto, char>
 {
     static std::string short_name() {return std::string(1, 'f');}
     static std::string long_name() {return std::string("femto");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -153,6 +187,8 @@
 {
     static std::u16string short_name() {return std::u16string(1, u'f');}
     static std::u16string long_name() {return std::u16string(u"femto");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
 };
 
 template <>
@@ -160,6 +196,8 @@
 {
     static std::u32string short_name() {return std::u32string(1, U'f');}
     static std::u32string long_name() {return std::u32string(U"femto");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
 };
 
 #endif
@@ -170,12 +208,20 @@
 {
     static std::wstring short_name() {return std::wstring(1, L'f');}
     static std::wstring long_name() {return std::wstring(L"femto");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
 };
 #endif
 #endif
 
 // pico
 
+template <>
+struct ratio_string_is_localizable<pico> : true_type {};
+
+template <>
+struct ratio_string_id<pico> : integral_constant<int,-12> {};
+
 #ifdef BOOST_RATIO_HAS_STATIC_STRING
 template <typename CharT>
 struct ratio_string<pico, CharT> :
@@ -188,6 +234,8 @@
 {
     static std::string short_name() {return std::string(1, 'p');}
     static std::string long_name() {return std::string("pico");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -197,6 +245,8 @@
 {
     static std::u16string short_name() {return std::u16string(1, u'p');}
     static std::u16string long_name() {return std::u16string(u"pico");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
 };
 
 template <>
@@ -204,6 +254,8 @@
 {
     static std::u32string short_name() {return std::u32string(1, U'p');}
     static std::u32string long_name() {return std::u32string(U"pico");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
 };
 
 #endif
@@ -214,12 +266,20 @@
 {
     static std::wstring short_name() {return std::wstring(1, L'p');}
     static std::wstring long_name() {return std::wstring(L"pico");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
 };
 #endif
 #endif
 
 // nano
 
+template <>
+struct ratio_string_is_localizable<nano> : true_type {};
+
+template <>
+struct ratio_string_id<nano> : integral_constant<int,-9> {};
+
 #ifdef BOOST_RATIO_HAS_STATIC_STRING
 template <typename CharT>
 struct ratio_string<nano, CharT> :
@@ -232,6 +292,8 @@
 {
     static std::string short_name() {return std::string(1, 'n');}
     static std::string long_name() {return std::string("nano");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -241,6 +303,8 @@
 {
     static std::u16string short_name() {return std::u16string(1, u'n');}
     static std::u16string long_name() {return std::u16string(u"nano");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
 };
 
 template <>
@@ -248,6 +312,8 @@
 {
     static std::u32string short_name() {return std::u32string(1, U'n');}
     static std::u32string long_name() {return std::u32string(U"nano");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
 };
 
 #endif
@@ -258,12 +324,20 @@
 {
     static std::wstring short_name() {return std::wstring(1, L'n');}
     static std::wstring long_name() {return std::wstring(L"nano");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
 };
 #endif
 #endif
 
 // micro
 
+template <>
+struct ratio_string_is_localizable<micro> : true_type {};
+
+template <>
+struct ratio_string_id<micro> : integral_constant<int,-6> {};
+
 #ifdef BOOST_RATIO_HAS_STATIC_STRING
 template <typename CharT>
 struct ratio_string<micro, CharT> :
@@ -276,6 +350,8 @@
 {
     static std::string short_name() {return std::string("\xC2\xB5");}
     static std::string long_name() {return std::string("micro");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -285,6 +361,8 @@
 {
     static std::u16string short_name() {return std::u16string(1, u'\xB5');}
     static std::u16string long_name() {return std::u16string(u"micro");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
 };
 
 template <>
@@ -292,6 +370,8 @@
 {
     static std::u32string short_name() {return std::u32string(1, U'\xB5');}
     static std::u32string long_name() {return std::u32string(U"micro");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
 };
 
 #endif
@@ -302,12 +382,20 @@
 {
     static std::wstring short_name() {return std::wstring(1, L'\xB5');}
     static std::wstring long_name() {return std::wstring(L"micro");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
 };
 #endif
 #endif
 
 // milli
 
+template <>
+struct ratio_string_is_localizable<milli> : true_type {};
+
+template <>
+struct ratio_string_id<milli> : integral_constant<int,-3> {};
+
 #ifdef BOOST_RATIO_HAS_STATIC_STRING
 template <typename CharT>
 struct ratio_string<milli, CharT> :
@@ -320,6 +408,8 @@
 {
     static std::string short_name() {return std::string(1, 'm');}
     static std::string long_name() {return std::string("milli");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -328,7 +418,9 @@
 struct ratio_string<milli, char16_t>
 {
     static std::u16string short_name() {return std::u16string(1, u'm');}
- static std::u16string long_name() {return std::u16string(u"milli");}
+ static std::u32string long_name() {return std::u16string(u"milli");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
 };
 
 template <>
@@ -336,6 +428,8 @@
 {
     static std::u32string short_name() {return std::u32string(1, U'm');}
     static std::u32string long_name() {return std::u32string(U"milli");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
 };
 
 #endif
@@ -346,12 +440,20 @@
 {
     static std::wstring short_name() {return std::wstring(1, L'm');}
     static std::wstring long_name() {return std::wstring(L"milli");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
 };
 #endif
 #endif
 
 // centi
 
+template <>
+struct ratio_string_is_localizable<centi> : true_type {};
+
+template <>
+struct ratio_string_id<centi> : integral_constant<int,-2> {};
+
 #ifdef BOOST_RATIO_HAS_STATIC_STRING
 template <typename CharT>
 struct ratio_string<centi, CharT> :
@@ -364,6 +466,8 @@
 {
     static std::string short_name() {return std::string(1, 'c');}
     static std::string long_name() {return std::string("centi");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -373,6 +477,8 @@
 {
     static std::u16string short_name() {return std::u16string(1, u'c');}
     static std::u16string long_name() {return std::u16string(u"centi");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
 };
 
 template <>
@@ -380,6 +486,8 @@
 {
     static std::u32string short_name() {return std::u32string(1, U'c');}
     static std::u32string long_name() {return std::u32string(U"centi");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
 };
 
 #endif
@@ -390,11 +498,20 @@
 {
     static std::wstring short_name() {return std::wstring(1, L'c');}
     static std::wstring long_name() {return std::wstring(L"centi");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
 };
 #endif
 #endif
 
 // deci
+
+template <>
+struct ratio_string_is_localizable<deci> : true_type {};
+
+template <>
+struct ratio_string_id<deci> : integral_constant<int,-1> {};
+
 #ifdef BOOST_RATIO_HAS_STATIC_STRING
 template <typename CharT>
 struct ratio_string<deci, CharT> :
@@ -408,6 +525,8 @@
 {
     static std::string short_name() {return std::string(1, 'd');}
     static std::string long_name() {return std::string("deci");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -417,6 +536,8 @@
 {
     static std::u16string short_name() {return std::u16string(1, u'd');}
     static std::u16string long_name() {return std::u16string(u"deci");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
 };
 
 template <>
@@ -424,6 +545,8 @@
 {
     static std::u32string short_name() {return std::u32string(1, U'd');}
     static std::u32string long_name() {return std::u32string(U"deci");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
 };
 
 #endif
@@ -434,12 +557,27 @@
 {
     static std::wstring short_name() {return std::wstring(1, L'd');}
     static std::wstring long_name() {return std::wstring(L"deci");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
 };
 #endif
 #endif
 
+// unit
+
+template <>
+struct ratio_string_is_localizable<ratio<1> > : true_type {};
+
+template <>
+struct ratio_string_id<ratio<1> > : integral_constant<int,0> {};
 // deca
 
+template <>
+struct ratio_string_is_localizable<deca> : true_type {};
+
+template <>
+struct ratio_string_id<deca> : integral_constant<int,1> {};
+
 #ifdef BOOST_RATIO_HAS_STATIC_STRING
 template <typename CharT>
 struct ratio_string<deca, CharT> :
@@ -452,6 +590,8 @@
 {
     static std::string short_name() {return std::string("da");}
     static std::string long_name() {return std::string("deca");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -461,6 +601,8 @@
 {
     static std::u16string short_name() {return std::u16string(u"da");}
     static std::u16string long_name() {return std::u16string(u"deca");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
 };
 
 template <>
@@ -468,6 +610,8 @@
 {
     static std::u32string short_name() {return std::u32string(U"da");}
     static std::u32string long_name() {return std::u32string(U"deca");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
 };
 
 #endif
@@ -478,12 +622,21 @@
 {
     static std::wstring short_name() {return std::wstring(L"da");}
     static std::wstring long_name() {return std::wstring(L"deca");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
 };
 #endif
 #endif
 
 // hecto
 
+template <>
+struct ratio_string_is_localizable<hecto> : true_type {};
+
+template <>
+struct ratio_string_id<hecto> : integral_constant<int,2> {};
+
+
 #ifdef BOOST_RATIO_HAS_STATIC_STRING
 template <typename CharT>
 struct ratio_string<hecto, CharT> :
@@ -496,6 +649,8 @@
 {
     static std::string short_name() {return std::string(1, 'h');}
     static std::string long_name() {return std::string("hecto");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -505,6 +660,8 @@
 {
     static std::u16string short_name() {return std::u16string(1, u'h');}
     static std::u16string long_name() {return std::u16string(u"hecto");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
 };
 
 template <>
@@ -512,6 +669,8 @@
 {
     static std::u32string short_name() {return std::u32string(1, U'h');}
     static std::u32string long_name() {return std::u32string(U"hecto");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
 };
 
 #endif
@@ -522,12 +681,20 @@
 {
     static std::wstring short_name() {return std::wstring(1, L'h');}
     static std::wstring long_name() {return std::wstring(L"hecto");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
 };
 #endif
 #endif
 
 // kilo
 
+template <>
+struct ratio_string_is_localizable<kilo> : true_type {};
+
+template <>
+struct ratio_string_id<kilo> : integral_constant<int,3> {};
+
 #ifdef BOOST_RATIO_HAS_STATIC_STRING
 template <typename CharT>
 struct ratio_string<kilo, CharT> :
@@ -540,6 +707,8 @@
 {
     static std::string short_name() {return std::string(1, 'k');}
     static std::string long_name() {return std::string("kilo");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -549,6 +718,8 @@
 {
     static std::u16string short_name() {return std::u16string(1, u'k');}
     static std::u16string long_name() {return std::u16string(u"kilo");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
 };
 
 template <>
@@ -556,6 +727,8 @@
 {
     static std::u32string short_name() {return std::u32string(1, U'k');}
     static std::u32string long_name() {return std::u32string(U"kilo");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
 };
 
 #endif
@@ -566,12 +739,20 @@
 {
     static std::wstring short_name() {return std::wstring(1, L'k');}
     static std::wstring long_name() {return std::wstring(L"kilo");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
 };
 #endif
 #endif
 
 // mega
 
+template <>
+struct ratio_string_is_localizable<mega> : true_type {};
+
+template <>
+struct ratio_string_id<mega> : integral_constant<int,6> {};
+
 #ifdef BOOST_RATIO_HAS_STATIC_STRING
 template <typename CharT>
 struct ratio_string<mega, CharT> :
@@ -585,6 +766,8 @@
 {
     static std::string short_name() {return std::string(1, 'M');}
     static std::string long_name() {return std::string("mega");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -594,6 +777,8 @@
 {
     static std::u16string short_name() {return std::u16string(1, u'M');}
     static std::u16string long_name() {return std::u16string(u"mega");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
 };
 
 template <>
@@ -601,6 +786,8 @@
 {
     static std::u32string short_name() {return std::u32string(1, U'M');}
     static std::u32string long_name() {return std::u32string(U"mega");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
 };
 
 #endif
@@ -611,11 +798,20 @@
 {
     static std::wstring short_name() {return std::wstring(1, L'M');}
     static std::wstring long_name() {return std::wstring(L"mega");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
 };
 #endif
 #endif
 
 // giga
+
+template <>
+struct ratio_string_is_localizable<giga> : true_type {};
+
+template <>
+struct ratio_string_id<giga> : integral_constant<int,9> {};
+
 #ifdef BOOST_RATIO_HAS_STATIC_STRING
 template <typename CharT>
 struct ratio_string<giga, CharT> :
@@ -629,6 +825,8 @@
 {
     static std::string short_name() {return std::string(1, 'G');}
     static std::string long_name() {return std::string("giga");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -638,6 +836,8 @@
 {
     static std::u16string short_name() {return std::u16string(1, u'G');}
     static std::u16string long_name() {return std::u16string(u"giga");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
 };
 
 template <>
@@ -645,6 +845,8 @@
 {
     static std::u32string short_name() {return std::u32string(1, U'G');}
     static std::u32string long_name() {return std::u32string(U"giga");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
 };
 
 #endif
@@ -655,11 +857,20 @@
 {
     static std::wstring short_name() {return std::wstring(1, L'G');}
     static std::wstring long_name() {return std::wstring(L"giga");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
 };
 #endif
 #endif
 
 // tera
+
+template <>
+struct ratio_string_is_localizable<tera> : true_type {};
+
+template <>
+struct ratio_string_id<tera> : integral_constant<int,12> {};
+
 #ifdef BOOST_RATIO_HAS_STATIC_STRING
 template <typename CharT>
 struct ratio_string<tera, CharT> :
@@ -672,6 +883,8 @@
 {
     static std::string short_name() {return std::string(1, 'T');}
     static std::string long_name() {return std::string("tera");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -681,6 +894,8 @@
 {
     static std::u16string short_name() {return std::u16string(1, u'T');}
     static std::u16string long_name() {return std::u16string(u"tera");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
 };
 
 template <>
@@ -688,6 +903,8 @@
 {
     static std::u32string short_name() {return std::u32string(1, U'T');}
     static std::u32string long_name() {return std::u32string(U"tera");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
 };
 
 #endif
@@ -698,11 +915,21 @@
 {
     static std::wstring short_name() {return std::wstring(1, L'T');}
     static std::wstring long_name() {return std::wstring(L"tera");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
 };
 #endif
 #endif
 
 // peta
+
+template <>
+struct ratio_string_is_localizable<peta> : true_type {};
+
+template <>
+struct ratio_string_id<peta> : integral_constant<int,15> {};
+
+
 #ifdef BOOST_RATIO_HAS_STATIC_STRING
 template <typename CharT>
 struct ratio_string<peta, CharT> :
@@ -715,6 +942,8 @@
 {
     static std::string short_name() {return std::string(1, 'P');}
     static std::string long_name() {return std::string("peta");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -724,6 +953,8 @@
 {
     static std::u16string short_name() {return std::u16string(1, u'P');}
     static std::u16string long_name() {return std::u16string(u"peta");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
 };
 
 template <>
@@ -731,6 +962,8 @@
 {
     static std::u32string short_name() {return std::u32string(1, U'P');}
     static std::u32string long_name() {return std::u32string(U"peta");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
 };
 
 #endif
@@ -741,11 +974,20 @@
 {
     static std::wstring short_name() {return std::wstring(1, L'P');}
     static std::wstring long_name() {return std::wstring(L"peta");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
 };
 #endif
 #endif
 
 // exa
+
+template <>
+struct ratio_string_is_localizable<exa> : true_type {};
+
+template <>
+struct ratio_string_id<exa> : integral_constant<int,18> {};
+
 #ifdef BOOST_RATIO_HAS_STATIC_STRING
 template <typename CharT>
 struct ratio_string<exa, CharT> :
@@ -758,6 +1000,8 @@
 {
     static std::string short_name() {return std::string(1, 'E');}
     static std::string long_name() {return std::string("exa");}
+ static std::string symbol() {return short_name();}
+ static std::string prefix() {return long_name();}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -767,6 +1011,8 @@
 {
     static std::u16string short_name() {return std::u16string(1, u'E');}
     static std::u16string long_name() {return std::u16string(u"exa");}
+ static std::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
 };
 
 template <>
@@ -774,6 +1020,8 @@
 {
     static std::u32string short_name() {return std::u32string(1, U'E');}
     static std::u32string long_name() {return std::u32string(U"exa");}
+ static std::u32string symbol() {return short_name();}
+ static std::u32string prefix() {return long_name();}
 };
 
 #endif
@@ -784,6 +1032,8 @@
 {
     static std::wstring short_name() {return std::wstring(1, L'E');}
     static std::wstring long_name() {return std::wstring(L"exa");}
+ static std::wstring symbol() {return short_name();}
+ static std::wstring prefix() {return long_name();}
 };
 #endif
 #endif


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