Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80317 - in trunk: boost/ratio boost/ratio/detail libs/ratio/doc libs/ratio/example libs/ratio/test libs/ratio/test/ratio_io
From: vicente.botet_at_[hidden]
Date: 2012-08-30 01:00:12


Author: viboes
Date: 2012-08-30 01:00:10 EDT (Thu, 30 Aug 2012)
New Revision: 80317
URL: http://svn.boost.org/trac/boost/changeset/80317

Log:
Ratio: version 2: Added prefix/symbol functions ratio_io.
Added:
   trunk/boost/ratio/config.hpp (contents, props changed)
   trunk/boost/ratio/detail/ratio_io.hpp (contents, props changed)
Text files modified:
   trunk/boost/ratio/detail/overflow_helpers.hpp | 32 --
   trunk/boost/ratio/ratio.hpp | 2
   trunk/boost/ratio/ratio_fwd.hpp | 9
   trunk/boost/ratio/ratio_io.hpp | 527 +++++++++++----------------------------
   trunk/libs/ratio/doc/ratio.qbk | 407 +++++++++++++++++++++++++-----
   trunk/libs/ratio/example/display_ex.cpp | 26
   trunk/libs/ratio/test/Jamfile.v2 | 1
   trunk/libs/ratio/test/ratio_io/ratio_io_fail.cpp | 4
   trunk/libs/ratio/test/ratio_io/ratio_io_pass.cpp | 64 ++--
   9 files changed, 541 insertions(+), 531 deletions(-)

Added: trunk/boost/ratio/config.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/ratio/config.hpp 2012-08-30 01:00:10 EDT (Thu, 30 Aug 2012)
@@ -0,0 +1,75 @@
+// config.hpp ---------------------------------------------------------------//
+
+// Copyright 2012 Vicente J. Botet Escriba
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+
+#ifndef BOOST_RATIO_CONFIG_HPP
+#define BOOST_RATIO_CONFIG_HPP
+
+#include <boost/config.hpp>
+#include <boost/cstdint.hpp>
+
+#if !defined BOOST_RATIO_VERSION
+#define BOOST_RATIO_VERSION 1
+#else
+#if BOOST_RATIO_VERSION!=1 && BOOST_RATIO_VERSION!=2
+#error "BOOST_RATIO_VERSION must be 1 or 2"
+#endif
+#endif
+
+#if BOOST_RATIO_VERSION==1
+#if ! defined BOOST_RATIO_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V2_0_0
+#define BOOST_RATIO_PROVIDES_DEPRECATED_FEATURES_SINCE_V2_0_0
+#endif
+#endif
+
+#if BOOST_RATIO_VERSION==2
+#if ! defined BOOST_RATIO_PROVIDES_DEPRECATED_FEATURES_SINCE_V2_0_0
+#define BOOST_RATIO_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V2_0_0
+#endif
+#endif
+
+#ifdef INTMAX_C
+#define BOOST_RATIO_INTMAX_C(a) INTMAX_C(a)
+#else
+#define BOOST_RATIO_INTMAX_C(a) a##LL
+#endif
+
+#define BOOST_RATIO_INTMAX_T_MAX (0x7FFFFFFFFFFFFFFELL)
+
+
+#ifndef BOOST_NO_CXX11_STATIC_ASSERT
+#define BOOST_RATIO_STATIC_ASSERT(CND, MSG, TYPES) static_assert(CND,MSG)
+#elif defined(BOOST_RATIO_USES_STATIC_ASSERT)
+#include <boost/static_assert.hpp>
+#define BOOST_RATIO_STATIC_ASSERT(CND, MSG, TYPES) BOOST_STATIC_ASSERT(CND)
+#elif defined(BOOST_RATIO_USES_MPL_ASSERT)
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/bool.hpp>
+#define BOOST_RATIO_STATIC_ASSERT(CND, MSG, TYPES) \
+ BOOST_MPL_ASSERT_MSG(boost::mpl::bool_< (CND) >::type::value, MSG, TYPES)
+#else
+//~ #elif defined(BOOST_RATIO_USES_ARRAY_ASSERT)
+#define BOOST_RATIO_CONCAT(A,B) A##B
+#define BOOST_RATIO_NAME(A,B) BOOST_RATIO_CONCAT(A,B)
+#define BOOST_RATIO_STATIC_ASSERT(CND, MSG, TYPES) static char BOOST_RATIO_NAME(__boost_ratio_test_,__LINE__)[(CND)?1:-1]
+//~ #define BOOST_RATIO_STATIC_ASSERT(CND, MSG, TYPES)
+#endif
+
+#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) || !defined(BOOST_RATIO_USES_MPL_ASSERT)
+#define BOOST_RATIO_OVERFLOW_IN_ADD "overflow in ratio add"
+#define BOOST_RATIO_OVERFLOW_IN_SUB "overflow in ratio sub"
+#define BOOST_RATIO_OVERFLOW_IN_MUL "overflow in ratio mul"
+#define BOOST_RATIO_OVERFLOW_IN_DIV "overflow in ratio div"
+#define BOOST_RATIO_NUMERATOR_IS_OUT_OF_RANGE "ratio numerator is out of range"
+#define BOOST_RATIO_DIVIDE_BY_0 "ratio divide by 0"
+#define BOOST_RATIO_DENOMINATOR_IS_OUT_OF_RANGE "ratio denominator is out of range"
+#endif
+
+
+//#define BOOST_RATIO_EXTENSIONS
+
+#endif // header

Modified: trunk/boost/ratio/detail/overflow_helpers.hpp
==============================================================================
--- trunk/boost/ratio/detail/overflow_helpers.hpp (original)
+++ trunk/boost/ratio/detail/overflow_helpers.hpp 2012-08-30 01:00:10 EDT (Thu, 30 Aug 2012)
@@ -32,6 +32,7 @@
 #ifndef BOOST_RATIO_DETAIL_RATIO_OPERATIONS_HPP
 #define BOOST_RATIO_DETAIL_RATIO_OPERATIONS_HPP
 
+#include <boost/ratio/config.hpp>
 #include <boost/ratio/detail/mpl/abs.hpp>
 #include <boost/ratio/detail/mpl/sign.hpp>
 #include <cstdlib>
@@ -42,37 +43,6 @@
 #include <boost/utility/enable_if.hpp>
 #include <boost/integer_traits.hpp>
 
-#define BOOST_RATIO_INTMAX_T_MAX (0x7FFFFFFFFFFFFFFELL)
-
-#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) || !defined(BOOST_RATIO_USES_MPL_ASSERT)
-#define BOOST_RATIO_OVERFLOW_IN_ADD "overflow in ratio add"
-#define BOOST_RATIO_OVERFLOW_IN_SUB "overflow in ratio sub"
-#define BOOST_RATIO_OVERFLOW_IN_MUL "overflow in ratio mul"
-#define BOOST_RATIO_OVERFLOW_IN_DIV "overflow in ratio div"
-#define BOOST_RATIO_NUMERATOR_IS_OUT_OF_RANGE "ratio numerator is out of range"
-#define BOOST_RATIO_DIVIDE_BY_0 "ratio divide by 0"
-#define BOOST_RATIO_DENOMINATOR_IS_OUT_OF_RANGE "ratio denominator is out of range"
-#endif
-
-#ifndef BOOST_NO_CXX11_STATIC_ASSERT
-#define BOOST_RATIO_STATIC_ASSERT(CND, MSG, TYPES) static_assert(CND,MSG)
-#elif defined(BOOST_RATIO_USES_STATIC_ASSERT)
-#include <boost/static_assert.hpp>
-#define BOOST_RATIO_STATIC_ASSERT(CND, MSG, TYPES) BOOST_STATIC_ASSERT(CND)
-#elif defined(BOOST_RATIO_USES_MPL_ASSERT)
-#include <boost/mpl/assert.hpp>
-#include <boost/mpl/bool.hpp>
-#define BOOST_RATIO_STATIC_ASSERT(CND, MSG, TYPES) \
- BOOST_MPL_ASSERT_MSG(boost::mpl::bool_< (CND) >::type::value, MSG, TYPES)
-#else
-//~ #elif defined(BOOST_RATIO_USES_ARRAY_ASSERT)
-#define BOOST_RATIO_CONCAT(A,B) A##B
-#define BOOST_RATIO_NAME(A,B) BOOST_RATIO_CONCAT(A,B)
-#define BOOST_RATIO_STATIC_ASSERT(CND, MSG, TYPES) static char BOOST_RATIO_NAME(__boost_ratio_test_,__LINE__)[(CND)?1:-1]
-//~ #define BOOST_RATIO_STATIC_ASSERT(CND, MSG, TYPES)
-#endif
-
-
 //
 // We simply cannot include this header on gcc without getting copious warnings of the kind:
 //

Added: trunk/boost/ratio/detail/ratio_io.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/ratio/detail/ratio_io.hpp 2012-08-30 01:00:10 EDT (Thu, 30 Aug 2012)
@@ -0,0 +1,1043 @@
+// ratio_io
+//
+// (C) Copyright Howard Hinnant
+// (C) Copyright 2010 Vicente J. Botet Escriba
+// Use, modification and distribution are subject to 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).
+//
+// This code was adapted by Vicente from Howard Hinnant's experimental work
+// on chrono i/o under lvm/libc++ to Boost
+
+#ifndef BOOST_RATIO_DETAIL_RATIO_IO_HPP
+#define BOOST_RATIO_DETAIL_RATIO_IO_HPP
+
+/*
+
+ ratio_io synopsis
+
+#include <ratio>
+#include <string>
+
+namespace boost
+{
+
+template <class Ratio, class CharT>
+struct ratio_string
+{
+ static basic_string<CharT> short_name();
+ static basic_string<CharT> long_name();
+};
+
+} // boost
+
+*/
+
+#include <boost/config.hpp>
+#include <boost/ratio/ratio.hpp>
+#include <boost/type_traits/integral_constant.hpp>
+#include <string>
+#include <sstream>
+
+#ifdef BOOST_RATIO_HAS_STATIC_STRING
+#include <boost/ratio/ratio_static_string.hpp>
+#include <boost/static_string/static_string.hpp>
+#endif
+
+#if defined(BOOST_NO_CXX11_UNICODE_LITERALS) || defined(BOOST_NO_CXX11_CHAR16_T) || defined(BOOST_NO_CXX11_CHAR32_T)
+//~ #define BOOST_RATIO_HAS_UNICODE_SUPPORT
+#else
+#define BOOST_RATIO_HAS_UNICODE_SUPPORT 1
+#endif
+
+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>
+std::basic_string<CharT>
+ratio_string<Ratio, CharT>::long_name()
+{
+ std::basic_ostringstream<CharT> os;
+ os << CharT('[') << Ratio::num << CharT('/')
+ << Ratio::den << CharT(']');
+ return os.str();
+}
+
+#ifdef BOOST_RATIO_HAS_STATIC_STRING
+namespace ratio_detail {
+template <class Ratio, class CharT>
+struct ratio_string_static
+{
+ static std::string short_name() {
+ return std::basic_string<CharT>(
+ static_string::c_str<
+ typename ratio_static_string<Ratio, CharT>::short_name
+ >::value);
+ }
+ static std::string long_name() {
+ return std::basic_string<CharT>(
+ static_string::c_str<
+ 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> :
+ ratio_detail::ratio_string_static<atto,CharT>
+{};
+
+#else
+template <>
+struct ratio_string<atto, char>
+{
+ 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
+
+template <>
+struct ratio_string<atto, char16_t>
+{
+ 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 <>
+struct ratio_string<atto, char32_t>
+{
+ 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
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_string<atto, wchar_t>
+{
+ 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> :
+ ratio_detail::ratio_string_static<femto,CharT>
+{};
+
+#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
+
+template <>
+struct ratio_string<femto, char16_t>
+{
+ 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 <>
+struct ratio_string<femto, char32_t>
+{
+ 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
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_string<femto, wchar_t>
+{
+ 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> :
+ ratio_detail::ratio_string_static<pico,CharT>
+{};
+
+#else
+template <>
+struct ratio_string<pico, char>
+{
+ 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
+
+template <>
+struct ratio_string<pico, char16_t>
+{
+ 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 <>
+struct ratio_string<pico, char32_t>
+{
+ 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
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_string<pico, wchar_t>
+{
+ 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> :
+ ratio_detail::ratio_string_static<nano,CharT>
+{};
+
+#else
+template <>
+struct ratio_string<nano, char>
+{
+ 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
+
+template <>
+struct ratio_string<nano, char16_t>
+{
+ 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 <>
+struct ratio_string<nano, char32_t>
+{
+ 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
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_string<nano, wchar_t>
+{
+ 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> :
+ ratio_detail::ratio_string_static<micro,CharT>
+{};
+
+#else
+template <>
+struct ratio_string<micro, char>
+{
+ 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
+
+template <>
+struct ratio_string<micro, char16_t>
+{
+ 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 <>
+struct ratio_string<micro, char32_t>
+{
+ 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
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_string<micro, wchar_t>
+{
+ 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> :
+ ratio_detail::ratio_string_static<milli,CharT>
+{};
+
+#else
+template <>
+struct ratio_string<milli, char>
+{
+ 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
+
+template <>
+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::u16string symbol() {return short_name();}
+ static std::u16string prefix() {return long_name();}
+};
+
+template <>
+struct ratio_string<milli, char32_t>
+{
+ 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
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_string<milli, wchar_t>
+{
+ 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> :
+ ratio_detail::ratio_string_static<centi,CharT>
+{};
+
+#else
+template <>
+struct ratio_string<centi, char>
+{
+ 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
+
+template <>
+struct ratio_string<centi, char16_t>
+{
+ 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 <>
+struct ratio_string<centi, char32_t>
+{
+ 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
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_string<centi, wchar_t>
+{
+ 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> :
+ ratio_detail::ratio_string_static<deci,CharT>
+{};
+
+#else
+
+template <>
+struct ratio_string<deci, char>
+{
+ 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
+
+template <>
+struct ratio_string<deci, char16_t>
+{
+ 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 <>
+struct ratio_string<deci, char32_t>
+{
+ 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
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_string<deci, wchar_t>
+{
+ 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> :
+ ratio_detail::ratio_string_static<deca,CharT>
+{};
+
+#else
+template <>
+struct ratio_string<deca, char>
+{
+ 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
+
+template <>
+struct ratio_string<deca, char16_t>
+{
+ 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 <>
+struct ratio_string<deca, char32_t>
+{
+ 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
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_string<deca, wchar_t>
+{
+ 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> :
+ ratio_detail::ratio_string_static<hecto,CharT>
+{};
+
+#else
+template <>
+struct ratio_string<hecto, char>
+{
+ 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
+
+template <>
+struct ratio_string<hecto, char16_t>
+{
+ 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 <>
+struct ratio_string<hecto, char32_t>
+{
+ 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
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_string<hecto, wchar_t>
+{
+ 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> :
+ ratio_detail::ratio_string_static<kilo,CharT>
+{};
+
+#else
+template <>
+struct ratio_string<kilo, char>
+{
+ 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
+
+template <>
+struct ratio_string<kilo, char16_t>
+{
+ 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 <>
+struct ratio_string<kilo, char32_t>
+{
+ 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
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_string<kilo, wchar_t>
+{
+ 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> :
+ ratio_detail::ratio_string_static<mega,CharT>
+{};
+
+#else
+
+template <>
+struct ratio_string<mega, char>
+{
+ 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
+
+template <>
+struct ratio_string<mega, char16_t>
+{
+ 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 <>
+struct ratio_string<mega, char32_t>
+{
+ 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
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_string<mega, wchar_t>
+{
+ 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> :
+ ratio_detail::ratio_string_static<giga,CharT>
+{};
+
+#else
+
+template <>
+struct ratio_string<giga, char>
+{
+ 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
+
+template <>
+struct ratio_string<giga, char16_t>
+{
+ 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 <>
+struct ratio_string<giga, char32_t>
+{
+ 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
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_string<giga, wchar_t>
+{
+ 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> :
+ ratio_detail::ratio_string_static<tera,CharT>
+{};
+
+#else
+template <>
+struct ratio_string<tera, char>
+{
+ 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
+
+template <>
+struct ratio_string<tera, char16_t>
+{
+ 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 <>
+struct ratio_string<tera, char32_t>
+{
+ 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
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_string<tera, wchar_t>
+{
+ 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> :
+ ratio_detail::ratio_string_static<peta,CharT>
+{};
+
+#else
+template <>
+struct ratio_string<peta, char>
+{
+ 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
+
+template <>
+struct ratio_string<peta, char16_t>
+{
+ 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 <>
+struct ratio_string<peta, char32_t>
+{
+ 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
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_string<peta, wchar_t>
+{
+ 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> :
+ ratio_detail::ratio_string_static<exa,CharT>
+{};
+
+#else
+template <>
+struct ratio_string<exa, char>
+{
+ 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
+
+template <>
+struct ratio_string<exa, char16_t>
+{
+ 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 <>
+struct ratio_string<exa, char32_t>
+{
+ 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
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_string<exa, wchar_t>
+{
+ 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
+
+}
+
+#endif // BOOST_RATIO_RATIO_IO_HPP

Modified: trunk/boost/ratio/ratio.hpp
==============================================================================
--- trunk/boost/ratio/ratio.hpp (original)
+++ trunk/boost/ratio/ratio.hpp 2012-08-30 01:00:10 EDT (Thu, 30 Aug 2012)
@@ -32,7 +32,7 @@
 #ifndef BOOST_RATIO_RATIO_HPP
 #define BOOST_RATIO_RATIO_HPP
 
-#include <boost/config.hpp>
+#include <boost/ratio/config.hpp>
 #include <boost/ratio/detail/mpl/abs.hpp>
 #include <boost/ratio/detail/mpl/sign.hpp>
 #include <boost/ratio/detail/mpl/gcd.hpp>

Modified: trunk/boost/ratio/ratio_fwd.hpp
==============================================================================
--- trunk/boost/ratio/ratio_fwd.hpp (original)
+++ trunk/boost/ratio/ratio_fwd.hpp 2012-08-30 01:00:10 EDT (Thu, 30 Aug 2012)
@@ -32,12 +32,7 @@
 #ifndef BOOST_RATIO_RATIO_FWD_HPP
 #define BOOST_RATIO_RATIO_FWD_HPP
 
-#include <boost/cstdint.hpp>
-#ifdef INTMAX_C
-#define BOOST_RATIO_INTMAX_C(a) INTMAX_C(a)
-#else
-#define BOOST_RATIO_INTMAX_C(a) a##LL
-#endif
+#include <boost/ratio/config.hpp>
 
 namespace boost
 {
@@ -82,7 +77,7 @@
 typedef ratio< BOOST_RATIO_INTMAX_C(1000000000000), BOOST_RATIO_INTMAX_C(1)> tera;
 typedef ratio< BOOST_RATIO_INTMAX_C(1000000000000000), BOOST_RATIO_INTMAX_C(1)> peta;
 typedef ratio<BOOST_RATIO_INTMAX_C(1000000000000000000), BOOST_RATIO_INTMAX_C(1)> exa;
-
+
 } // namespace boost
 
 

Modified: trunk/boost/ratio/ratio_io.hpp
==============================================================================
--- trunk/boost/ratio/ratio_io.hpp (original)
+++ trunk/boost/ratio/ratio_io.hpp 2012-08-30 01:00:10 EDT (Thu, 30 Aug 2012)
@@ -25,13 +25,18 @@
 template <class Ratio, class CharT>
 struct ratio_string
 {
- static basic_string<CharT> short_name();
- static basic_string<CharT> long_name();
+ static basic_string<CharT> prefix();
+ static basic_string<CharT> symbol();
 };
 
 } // boost
 
 */
+#include <boost/ratio/config.hpp>
+
+#ifdef BOOST_RATIO_PROVIDES_DEPRECATED_FEATURES_SINCE_V2_0_0
+#include <boost/ratio/detail/ratio_io.hpp>
+#else
 
 #include <boost/config.hpp>
 #include <boost/ratio/ratio.hpp>
@@ -52,23 +57,21 @@
 
 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>
+//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();}
+ static std::basic_string<CharT> symbol() {return prefix();}
+ static std::basic_string<CharT> prefix();
 };
 
 template <class Ratio, class CharT>
 std::basic_string<CharT>
-ratio_string<Ratio, CharT>::long_name()
+ratio_string<Ratio, CharT>::prefix()
 {
     std::basic_ostringstream<CharT> os;
     os << CharT('[') << Ratio::num << CharT('/')
@@ -81,29 +84,27 @@
 template <class Ratio, class CharT>
 struct ratio_string_static
 {
- static std::string short_name() {
+ static std::string symbol() {
         return std::basic_string<CharT>(
                 static_string::c_str<
- typename ratio_static_string<Ratio, CharT>::short_name
+ typename ratio_static_string<Ratio, CharT>::symbol
>::value);
     }
- static std::string long_name() {
+ static std::string prefix() {
         return std::basic_string<CharT>(
                 static_string::c_str<
- typename ratio_static_string<Ratio, CharT>::long_name
+ typename ratio_static_string<Ratio, CharT>::prefix
>::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> {};
+//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>
@@ -115,10 +116,8 @@
 template <>
 struct ratio_string<atto, char>
 {
- 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();}
+ static std::string symbol() {return std::string(1, 'a');}
+ static std::string prefix() {return std::string("atto");}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -126,19 +125,15 @@
 template <>
 struct ratio_string<atto, char16_t>
 {
- 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();}
+ static std::u16string symbol() {return std::u16string(1, u'a');}
+ static std::u16string prefix() {return std::u16string(u"atto");}
 };
 
 template <>
 struct ratio_string<atto, char32_t>
 {
- 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();}
+ static std::u32string symbol() {return std::u32string(1, U'a');}
+ static std::u32string prefix() {return std::u32string(U"atto");}
 };
 
 #endif
@@ -147,22 +142,14 @@
 template <>
 struct ratio_string<atto, wchar_t>
 {
- 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();}
+ static std::wstring symbol() {return std::wstring(1, L'a');}
+ static std::wstring prefix() {return std::wstring(L"atto");}
 };
 #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> :
@@ -174,10 +161,8 @@
 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();}
+ static std::string symbol() {return std::string(1, 'f');}
+ static std::string prefix() {return std::string("femto");}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -185,19 +170,15 @@
 template <>
 struct ratio_string<femto, char16_t>
 {
- 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();}
+ static std::u16string symbol() {return std::u16string(1, u'f');}
+ static std::u16string prefix() {return std::u16string(u"femto");}
 };
 
 template <>
 struct ratio_string<femto, char32_t>
 {
- 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();}
+ static std::u32string symbol() {return std::u32string(1, U'f');}
+ static std::u32string prefix() {return std::u32string(U"femto");}
 };
 
 #endif
@@ -206,22 +187,14 @@
 template <>
 struct ratio_string<femto, wchar_t>
 {
- 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();}
+ static std::wstring symbol() {return std::wstring(1, L'f');}
+ static std::wstring prefix() {return std::wstring(L"femto");}
 };
 #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> :
@@ -232,10 +205,8 @@
 template <>
 struct ratio_string<pico, char>
 {
- 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();}
+ static std::string symbol() {return std::string(1, 'p');}
+ static std::string prefix() {return std::string("pico");}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -243,19 +214,15 @@
 template <>
 struct ratio_string<pico, char16_t>
 {
- 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();}
+ static std::u16string symbol() {return std::u16string(1, u'p');}
+ static std::u16string prefix() {return std::u16string(u"pico");}
 };
 
 template <>
 struct ratio_string<pico, char32_t>
 {
- 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();}
+ static std::u32string symbol() {return std::u32string(1, U'p');}
+ static std::u32string prefix() {return std::u32string(U"pico");}
 };
 
 #endif
@@ -264,22 +231,14 @@
 template <>
 struct ratio_string<pico, wchar_t>
 {
- 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();}
+ static std::wstring symbol() {return std::wstring(1, L'p');}
+ static std::wstring prefix() {return std::wstring(L"pico");}
 };
 #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> :
@@ -290,10 +249,8 @@
 template <>
 struct ratio_string<nano, char>
 {
- 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();}
+ static std::string symbol() {return std::string(1, 'n');}
+ static std::string prefix() {return std::string("nano");}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -301,19 +258,15 @@
 template <>
 struct ratio_string<nano, char16_t>
 {
- 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();}
+ static std::u16string symbol() {return std::u16string(1, u'n');}
+ static std::u16string prefix() {return std::u16string(u"nano");}
 };
 
 template <>
 struct ratio_string<nano, char32_t>
 {
- 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();}
+ static std::u32string symbol() {return std::u32string(1, U'n');}
+ static std::u32string prefix() {return std::u32string(U"nano");}
 };
 
 #endif
@@ -322,22 +275,14 @@
 template <>
 struct ratio_string<nano, wchar_t>
 {
- 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();}
+ static std::wstring symbol() {return std::wstring(1, L'n');}
+ static std::wstring prefix() {return std::wstring(L"nano");}
 };
 #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> :
@@ -348,10 +293,8 @@
 template <>
 struct ratio_string<micro, char>
 {
- 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();}
+ static std::string symbol() {return std::string("\xC2\xB5");}
+ static std::string prefix() {return std::string("micro");}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -359,19 +302,15 @@
 template <>
 struct ratio_string<micro, char16_t>
 {
- 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();}
+ static std::u16string symbol() {return std::u16string(1, u'\xB5');}
+ static std::u16string prefix() {return std::u16string(u"micro");}
 };
 
 template <>
 struct ratio_string<micro, char32_t>
 {
- 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();}
+ static std::u32string symbol() {return std::u32string(1, U'\xB5');}
+ static std::u32string prefix() {return std::u32string(U"micro");}
 };
 
 #endif
@@ -380,22 +319,14 @@
 template <>
 struct ratio_string<micro, wchar_t>
 {
- 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();}
+ static std::wstring symbol() {return std::wstring(1, L'\xB5');}
+ static std::wstring prefix() {return std::wstring(L"micro");}
 };
 #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> :
@@ -406,10 +337,8 @@
 template <>
 struct ratio_string<milli, char>
 {
- 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();}
+ static std::string symbol() {return std::string(1, 'm');}
+ static std::string prefix() {return std::string("milli");}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -417,19 +346,15 @@
 template <>
 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::u16string symbol() {return short_name();}
- static std::u16string prefix() {return long_name();}
+ static std::u16string symbol() {return std::u16string(1, u'm');}
+ static std::u16string prefix() {return std::u16string(u"milli");}
 };
 
 template <>
 struct ratio_string<milli, char32_t>
 {
- 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();}
+ static std::u32string symbol() {return std::u32string(1, U'm');}
+ static std::u32string prefix() {return std::u32string(U"milli");}
 };
 
 #endif
@@ -438,22 +363,14 @@
 template <>
 struct ratio_string<milli, wchar_t>
 {
- 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();}
+ static std::wstring symbol() {return std::wstring(1, L'm');}
+ static std::wstring prefix() {return std::wstring(L"milli");}
 };
 #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> :
@@ -464,10 +381,8 @@
 template <>
 struct ratio_string<centi, char>
 {
- 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();}
+ static std::string symbol() {return std::string(1, 'c');}
+ static std::string prefix() {return std::string("centi");}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -475,19 +390,15 @@
 template <>
 struct ratio_string<centi, char16_t>
 {
- 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();}
+ static std::u16string symbol() {return std::u16string(1, u'c');}
+ static std::u16string prefix() {return std::u16string(u"centi");}
 };
 
 template <>
 struct ratio_string<centi, char32_t>
 {
- 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();}
+ static std::u32string symbol() {return std::u32string(1, U'c');}
+ static std::u32string prefix() {return std::u32string(U"centi");}
 };
 
 #endif
@@ -496,22 +407,14 @@
 template <>
 struct ratio_string<centi, wchar_t>
 {
- 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();}
+ static std::wstring symbol() {return std::wstring(1, L'c');}
+ static std::wstring prefix() {return std::wstring(L"centi");}
 };
 #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> :
@@ -523,10 +426,8 @@
 template <>
 struct ratio_string<deci, char>
 {
- 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();}
+ static std::string symbol() {return std::string(1, 'd');}
+ static std::string prefix() {return std::string("deci");}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -534,19 +435,15 @@
 template <>
 struct ratio_string<deci, char16_t>
 {
- 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();}
+ static std::u16string symbol() {return std::u16string(1, u'd');}
+ static std::u16string prefix() {return std::u16string(u"deci");}
 };
 
 template <>
 struct ratio_string<deci, char32_t>
 {
- 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();}
+ static std::u32string symbol() {return std::u32string(1, U'd');}
+ static std::u32string prefix() {return std::u32string(U"deci");}
 };
 
 #endif
@@ -555,28 +452,16 @@
 template <>
 struct ratio_string<deci, wchar_t>
 {
- 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();}
+ static std::wstring symbol() {return std::wstring(1, L'd');}
+ static std::wstring prefix() {return std::wstring(L"deci");}
 };
 #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>
@@ -588,10 +473,8 @@
 template <>
 struct ratio_string<deca, char>
 {
- 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();}
+ static std::string symbol() {return std::string("da");}
+ static std::string prefix() {return std::string("deca");}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -599,19 +482,15 @@
 template <>
 struct ratio_string<deca, char16_t>
 {
- 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();}
+ static std::u16string symbol() {return std::u16string(u"da");}
+ static std::u16string prefix() {return std::u16string(u"deca");}
 };
 
 template <>
 struct ratio_string<deca, char32_t>
 {
- 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();}
+ static std::u32string symbol() {return std::u32string(U"da");}
+ static std::u32string prefix() {return std::u32string(U"deca");}
 };
 
 #endif
@@ -620,23 +499,14 @@
 template <>
 struct ratio_string<deca, wchar_t>
 {
- 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();}
+ static std::wstring symbol() {return std::wstring(L"da");}
+ static std::wstring prefix() {return std::wstring(L"deca");}
 };
 #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> :
@@ -647,10 +517,8 @@
 template <>
 struct ratio_string<hecto, char>
 {
- 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();}
+ static std::string symbol() {return std::string(1, 'h');}
+ static std::string prefix() {return std::string("hecto");}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -658,19 +526,15 @@
 template <>
 struct ratio_string<hecto, char16_t>
 {
- 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();}
+ static std::u16string symbol() {return std::u16string(1, u'h');}
+ static std::u16string prefix() {return std::u16string(u"hecto");}
 };
 
 template <>
 struct ratio_string<hecto, char32_t>
 {
- 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();}
+ static std::u32string symbol() {return std::u32string(1, U'h');}
+ static std::u32string prefix() {return std::u32string(U"hecto");}
 };
 
 #endif
@@ -679,22 +543,14 @@
 template <>
 struct ratio_string<hecto, wchar_t>
 {
- 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();}
+ static std::wstring symbol() {return std::wstring(1, L'h');}
+ static std::wstring prefix() {return std::wstring(L"hecto");}
 };
 #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> :
@@ -705,10 +561,8 @@
 template <>
 struct ratio_string<kilo, char>
 {
- 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();}
+ static std::string symbol() {return std::string(1, 'k');}
+ static std::string prefix() {return std::string("kilo");}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -716,19 +570,15 @@
 template <>
 struct ratio_string<kilo, char16_t>
 {
- 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();}
+ static std::u16string symbol() {return std::u16string(1, u'k');}
+ static std::u16string prefix() {return std::u16string(u"kilo");}
 };
 
 template <>
 struct ratio_string<kilo, char32_t>
 {
- 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();}
+ static std::u32string symbol() {return std::u32string(1, U'k');}
+ static std::u32string prefix() {return std::u32string(U"kilo");}
 };
 
 #endif
@@ -737,22 +587,14 @@
 template <>
 struct ratio_string<kilo, wchar_t>
 {
- 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();}
+ static std::wstring symbol() {return std::wstring(1, L'k');}
+ static std::wstring prefix() {return std::wstring(L"kilo");}
 };
 #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> :
@@ -764,10 +606,8 @@
 template <>
 struct ratio_string<mega, char>
 {
- 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();}
+ static std::string symbol() {return std::string(1, 'M');}
+ static std::string prefix() {return std::string("mega");}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -775,19 +615,15 @@
 template <>
 struct ratio_string<mega, char16_t>
 {
- 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();}
+ static std::u16string symbol() {return std::u16string(1, u'M');}
+ static std::u16string prefix() {return std::u16string(u"mega");}
 };
 
 template <>
 struct ratio_string<mega, char32_t>
 {
- 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();}
+ static std::u32string symbol() {return std::u32string(1, U'M');}
+ static std::u32string prefix() {return std::u32string(U"mega");}
 };
 
 #endif
@@ -796,22 +632,14 @@
 template <>
 struct ratio_string<mega, wchar_t>
 {
- 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();}
+ static std::wstring symbol() {return std::wstring(1, L'M');}
+ static std::wstring prefix() {return std::wstring(L"mega");}
 };
 #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> :
@@ -823,10 +651,8 @@
 template <>
 struct ratio_string<giga, char>
 {
- 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();}
+ static std::string symbol() {return std::string(1, 'G');}
+ static std::string prefix() {return std::string("giga");}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -834,19 +660,15 @@
 template <>
 struct ratio_string<giga, char16_t>
 {
- 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();}
+ static std::u16string symbol() {return std::u16string(1, u'G');}
+ static std::u16string prefix() {return std::u16string(u"giga");}
 };
 
 template <>
 struct ratio_string<giga, char32_t>
 {
- 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();}
+ static std::u32string symbol() {return std::u32string(1, U'G');}
+ static std::u32string prefix() {return std::u32string(U"giga");}
 };
 
 #endif
@@ -855,22 +677,15 @@
 template <>
 struct ratio_string<giga, wchar_t>
 {
- 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();}
+ static std::wstring symbol() {return std::wstring(1, L'G');}
+ static std::wstring prefix() {return std::wstring(L"giga");}
 };
 #endif
 #endif
 
 // tera
 
-template <>
-struct ratio_string_is_localizable<tera> : true_type {};
-
-template <>
-struct ratio_string_id<tera> : integral_constant<int,12> {};
-
+//template <>
 #ifdef BOOST_RATIO_HAS_STATIC_STRING
 template <typename CharT>
 struct ratio_string<tera, CharT> :
@@ -881,10 +696,8 @@
 template <>
 struct ratio_string<tera, char>
 {
- 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();}
+ static std::string symbol() {return std::string(1, 'T');}
+ static std::string prefix() {return std::string("tera");}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -892,19 +705,15 @@
 template <>
 struct ratio_string<tera, char16_t>
 {
- 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();}
+ static std::u16string symbol() {return std::u16string(1, u'T');}
+ static std::u16string prefix() {return std::u16string(u"tera");}
 };
 
 template <>
 struct ratio_string<tera, char32_t>
 {
- 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();}
+ static std::u32string symbol() {return std::u32string(1, U'T');}
+ static std::u32string prefix() {return std::u32string(U"tera");}
 };
 
 #endif
@@ -913,23 +722,14 @@
 template <>
 struct ratio_string<tera, wchar_t>
 {
- 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();}
+ static std::wstring symbol() {return std::wstring(1, L'T');}
+ static std::wstring prefix() {return std::wstring(L"tera");}
 };
 #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> :
@@ -940,10 +740,8 @@
 template <>
 struct ratio_string<peta, char>
 {
- 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();}
+ static std::string symbol() {return std::string(1, 'P');}
+ static std::string prefix() {return std::string("peta");}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -951,19 +749,15 @@
 template <>
 struct ratio_string<peta, char16_t>
 {
- 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();}
+ static std::u16string symbol() {return std::u16string(1, u'P');}
+ static std::u16string prefix() {return std::u16string(u"peta");}
 };
 
 template <>
 struct ratio_string<peta, char32_t>
 {
- 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();}
+ static std::u32string symbol() {return std::u32string(1, U'P');}
+ static std::u32string prefix() {return std::u32string(U"peta");}
 };
 
 #endif
@@ -972,22 +766,14 @@
 template <>
 struct ratio_string<peta, wchar_t>
 {
- 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();}
+ static std::wstring symbol() {return std::wstring(1, L'P');}
+ static std::wstring prefix() {return std::wstring(L"peta");}
 };
 #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> :
@@ -998,10 +784,8 @@
 template <>
 struct ratio_string<exa, char>
 {
- 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();}
+ static std::string symbol() {return std::string(1, 'E');}
+ static std::string prefix() {return std::string("exa");}
 };
 
 #if BOOST_RATIO_HAS_UNICODE_SUPPORT
@@ -1009,19 +793,15 @@
 template <>
 struct ratio_string<exa, char16_t>
 {
- 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();}
+ static std::u16string symbol() {return std::u16string(1, u'E');}
+ static std::u16string prefix() {return std::u16string(u"exa");}
 };
 
 template <>
 struct ratio_string<exa, char32_t>
 {
- 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();}
+ static std::u32string symbol() {return std::u32string(1, U'E');}
+ static std::u32string prefix() {return std::u32string(U"exa");}
 };
 
 #endif
@@ -1030,14 +810,13 @@
 template <>
 struct ratio_string<exa, wchar_t>
 {
- 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();}
+ static std::wstring symbol() {return std::wstring(1, L'E');}
+ static std::wstring prefix() {return std::wstring(L"exa");}
 };
 #endif
 #endif
 
 }
 
+#endif // BOOST_RATIO_PROVIDES_DEPRECATED_FEATURES_SINCE_V2_0_0
 #endif // BOOST_RATIO_RATIO_IO_HPP

Modified: trunk/libs/ratio/doc/ratio.qbk
==============================================================================
--- trunk/libs/ratio/doc/ratio.qbk (original)
+++ trunk/libs/ratio/doc/ratio.qbk 2012-08-30 01:00:10 EDT (Thu, 30 Aug 2012)
@@ -9,13 +9,13 @@
 
 [library Boost.Ratio
     [quickbook 1.5]
- [version 1.0.1]
+ [version 2.0.0]
     [authors [Hinnant, Howard]]
     [authors [Dawes, Beman]]
     [authors [Botet Escriba, Vicente J.]]
     [copyright 2008 Howard Hinnant]
     [copyright 2006, 2008 Beman Dawes]
- [copyright 2009-2011 Vicente J. Botet Escriba]
+ [copyright 2009-2012 Vicente J. Botet Escriba]
     [category math]
     [id ratio]
     [dirname ratio]
@@ -42,12 +42,14 @@
 
 [template ratio_conf[link_text] [link ratio.reference.std.ratio_hpp.conf [link_text]]]
 
-[def __BOOST_RATIO_USES_STATIC_ASSERT [link ratio.reference.std.ratio_hpp.conf `BOOST_RATIO_USES_STATIC_ASSERT`]]
-[def __BOOST_RATIO_USES_MPL_ASSERT [link ratio.reference.std.ratio_hpp.conf `BOOST_RATIO_USES_MPL_ASSERT`]]
-[def __BOOST_RATIO_USES_ARRAY_ASSERT [link ratio.reference.std.ratio_hpp.conf `BOOST_RATIO_USES_ARRAY_ASSERT`]]
-
-[def __BOOST_RATIO_EXTENSIONS [link ratio.reference.std.ratio_hpp.extensions `BOOST_RATIO_EXTENSIONS`]]
-
+[def __BOOST_RATIO_USES_STATIC_ASSERT [link ratio.reference.config_hpp.assert `BOOST_RATIO_USES_STATIC_ASSERT`]]
+[def __BOOST_RATIO_USES_MPL_ASSERT [link ratio.reference.config_hpp.assert `BOOST_RATIO_USES_MPL_ASSERT`]]
+[def __BOOST_RATIO_USES_ARRAY_ASSERT [link ratio.reference.config_hpp.assert `BOOST_RATIO_USES_ARRAY_ASSERT`]]
+
+[def __BOOST_RATIO_EXTENSIONS [link ratio.reference.config_hpp.ext `BOOST_RATIO_EXTENSIONS`]]
+[def __BOOST_RATIO_PROVIDES_DEPRECATED_FEATURES_SINCE_V2_0_0 [link ratio.reference.config_hpp.deprecated `BOOST_RATIO_PROVIDES_DEPRECATED_FEATURES_SINCE_V2_0_0`]]
+[def __BOOST_RATIO_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V2_0_0 [link ratio.reference.config_hpp.deprecated `BOOST_RATIO_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V2_0_0 `]]
+[def __BOOST_RATIO_VERSION [link ratio.reference.config_hpp.version `BOOST_RATIO_VERSION `]]
 
 
 [template ratio_arithmetic[link_text] [link ratio.reference.std.ratio_hpp.ratio_arithmetic [link_text]]]
@@ -313,7 +315,7 @@
 
 [heading Ratio I/O]
 
-For each `ratio<N, D>` there exists a `ratio_string<ratio<N, D>, CharT>` for which you can query two strings: `short_name` and `long_name`. For those `ratio`'s that correspond to an [@http://en.wikipedia.org/wiki/SI_prefix#List_of_SI_prefixes SI prefix] long_name corresponds to the internationally recognized prefix, stored as a `basic_string<CharT>`. For example `ratio_string<mega, char>::long_name()` returns `string("mega")`. For those `ratio`s that correspond to an [@http://en.wikipedia.org/wiki/SI_prefix#List_of_SI_prefixes SI prefix] `short_name` corresponds to the internationally recognized symbol, stored as a `basic_string<CharT>`. For example, `ratio_string<mega, char>::short_name()` returns `string("M")`. For all other `ratio`s, both `long_name()` and `short_name()` return a `basic_string` containing "[`ratio::num/ratio::den`]".
+For each `ratio<N, D>` there exists a `ratio_string<ratio<N, D>, CharT>` for which you can query two strings: `symbol` and `prefix`. For those `ratio`'s that correspond to an [@http://en.wikipedia.org/wiki/SI_prefix#List_of_SI_prefixes SI prefix] prefix corresponds to the internationally recognized prefix, stored as a `basic_string<CharT>`. For example `ratio_string<mega, char>::prefix()` returns `string("mega")`. For those `ratio`s that correspond to an [@http://en.wikipedia.org/wiki/SI_prefix#List_of_SI_prefixes SI prefix] `symbol` corresponds to the internationally recognized symbol, stored as a `basic_string<CharT>`. For example, `ratio_string<mega, char>::symbol()` returns `string("M")`. For all other `ratio`s, both `prefix()` and `symbol()` return a `basic_string` containing "[`ratio::num/ratio::den`]".
 
 `ratio_string<ratio<N, D>, CharT>` is only defined for four character types:
 
@@ -324,7 +326,7 @@
 
 When the character is char, UTF-8 will be used to encode the names. When the character is `char16_t`, UTF-16 will be used to encode the names. When the character is `char32_t`, UTF-32 will be used to encode the names. When the character is `wchar_t`, the encoding will be UTF-16 if `wchar_t` is 16 bits, and otherwise UTF-32.
 
-The `short_name` (Greek mu or [mu]) for micro is defined by [@http://www.unicode.org/charts/PDF/U0080.pdf Unicode] to be U+00B5.
+The `symbol` (Greek mu or [mu]) for micro is defined by [@http://www.unicode.org/charts/PDF/U0080.pdf Unicode] to be U+00B5.
 
 [*Examples:]
 
@@ -336,30 +338,30 @@
         using namespace std;
         using namespace boost;
 
- cout << "ratio_string<deca, char>::long_name() = "
- << ratio_string<deca, char>::long_name() << '\n';
- cout << "ratio_string<deca, char>::short_name() = "
- << ratio_string<deca, char>::short_name() << '\n';
-
- cout << "ratio_string<giga, char>::long_name() = "
- << ratio_string<giga, char>::long_name() << '\n';
- cout << "ratio_string<giga, char>::short_name() = "
- << ratio_string<giga, char>::short_name() << '\n';
-
- cout << "ratio_string<ratio<4, 6>, char>::long_name() = "
- << ratio_string<ratio<4, 6>, char>::long_name() << '\n';
- cout << "ratio_string<ratio<4, 6>, char>::short_name() = "
- << ratio_string<ratio<4, 6>, char>::short_name() << '\n';
+ cout << "ratio_string<deca, char>::prefix() = "
+ << ratio_string<deca, char>::prefix() << '\n';
+ cout << "ratio_string<deca, char>::symbol() = "
+ << ratio_string<deca, char>::symbol() << '\n';
+
+ cout << "ratio_string<giga, char>::prefix() = "
+ << ratio_string<giga, char>::prefix() << '\n';
+ cout << "ratio_string<giga, char>::symbol() = "
+ << ratio_string<giga, char>::symbol() << '\n';
+
+ cout << "ratio_string<ratio<4, 6>, char>::prefix() = "
+ << ratio_string<ratio<4, 6>, char>::prefix() << '\n';
+ cout << "ratio_string<ratio<4, 6>, char>::symbol() = "
+ << ratio_string<ratio<4, 6>, char>::symbol() << '\n';
     }
 
 The output will be
 
- ratio_string<deca, char>::long_name() = deca
- ratio_string<deca, char>::short_name() = da
- ratio_string<giga, char>::long_name() = giga
- ratio_string<giga, char>::short_name() = G
- ratio_string<ratio<4, 6>, char>::long_name() = [2/3]
- ratio_string<ratio<4, 6>, char>::short_name() = [2/3]
+ ratio_string<deca, char>::prefix() = deca
+ ratio_string<deca, char>::symbol() = da
+ ratio_string<giga, char>::prefix() = giga
+ ratio_string<giga, char>::symbol() = G
+ ratio_string<ratio<4, 6>, char>::prefix() = [2/3]
+ ratio_string<ratio<4, 6>, char>::symbol() = [2/3]
 
 
 [heading Ratio MPL Numeric Metafunctions]
@@ -642,6 +644,68 @@
 [/=================]
 
 [/=================================================]
+[section:config_hpp Header `<boost/ratio/config.hpp>`]
+[/=================================================]
+
+
+ // Configuration macros
+ #define __BOOST_RATIO_VERSION
+ #define __BOOST_RATIO_EXTENSIONS
+ #define __BOOST_RATIO_PROVIDES_DEPRECATED_FEATURES_SINCE_V2_0_0
+ #define __BOOST_RATIO_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V2_0_0
+ #define __BOOST_RATIO_USES_STATIC_ASSERT
+ #define __BOOST_RATIO_USES_MPL_ASSERT
+ #define __BOOST_RATIO_USES_ARRAY_ASSERT
+
+
+[section:ext Extensions]
+
+When __BOOST_RATIO_EXTENSIONS is defined, __Boost_Ratio provides in addition some extension to the C++ standard, see below.
+
+[endsect]
+[section:deprecated Deprecated]
+
+When __BOOST_RATIO_PROVIDES_DEPRECATED_FEATURES_SINCE_V2_0_0 is defined the deprecated features stated as DEPRECATED V2 are provided.
+
+When __BOOST_RATIO_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V2_0_0 is defined the deprecated features stated as DEPRECATED V2 are NOT provided.
+
+[endsect]
+[section:version Version]
+
+__BOOST_RATIO_VERSION stands for the Boost.Ratio version which can be 1 or 2. The default up to 1.55 is version 1. Since 1.56 it will be 2.
+
+When __BOOST_RATIO_VERSION is 1 __BOOST_RATIO_PROVIDES_DEPRECATED_FEATURES_SINCE_V2_0_0 is defined by default.
+
+When __BOOST_RATIO_VERSION is 2 __BOOST_RATIO_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V2_0_0 is defined by default.
+
+[endsect]
+[section:assert Static Assert]
+
+When BOOST_NO_STATIC_ASSERT is defined, the user can select the way static assertions are reported. Define
+
+* __BOOST_RATIO_USES_STATIC_ASSERT to use Boost.StaticAssert.
+* __BOOST_RATIO_USES_MPL_ASSERT to use [*Boost.MPL] static assertions.
+* __BOOST_RATIO_USES_ARRAY_ASSERT to use __Boost_Ratio internal static assertions.
+
+The default behavior is as if __BOOST_RATIO_USES_ARRAY_ASSERT was defined.
+
+When __BOOST_RATIO_USES_MPL_ASSERT is not defined the following symbols are defined as shown:
+
+ #define BOOST_RATIO_OVERFLOW_IN_ADD "overflow in ratio add"
+ #define BOOST_RATIO_OVERFLOW_IN_SUB "overflow in ratio sub"
+ #define BOOST_RATIO_OVERFLOW_IN_MUL "overflow in ratio mul"
+ #define BOOST_RATIO_OVERFLOW_IN_DIV "overflow in ratio div"
+ #define BOOST_RATIO_NUMERATOR_IS_OUT_OF_RANGE "ratio numerator is out of range"
+ #define BOOST_RATIO_DIVIDE_BY_0 "ratio divide by 0"
+ #define BOOST_RATIO_DENOMINATOR_IS_OUT_OF_RANGE "ratio denominator is out of range"
+
+Depending upon the static assertion system used, a hint as to the failing assertion will appear in some form in the compiler diagnostic output.
+
+
+[endsect]
+[endsect]
+
+[/=================================================]
 [section:std C++0x Recommendation]
 [/=================================================]
 
@@ -707,46 +771,13 @@
 
 [endsect]
 
+
 [/=================================================]
 [section:ratio_hpp Header `<boost/ratio/ratio.hpp>`]
 [/=================================================]
 
 __ratio is a facility which is useful in specifying compile-time rational constants. Compile-time rational arithmetic is supported with protection against overflow and divide by zero. Such a facility is very handy to efficiently represent 1/3 of a nanosecond, or to specify an inch in terms of meters (for example 254/10000 meters - which __ratio will reduce to 127/5000 meters).
 
- // Configuration macros
- #define __BOOST_RATIO_USES_STATIC_ASSERT
- #define __BOOST_RATIO_USES_MPL_ASSERT
- #define __BOOST_RATIO_USES_ARRAY_ASSERT
- #define __BOOST_RATIO_EXTENSIONS
-
-
-[section:conf Configuration Macros]
-
-When BOOST_NO_STATIC_ASSERT is defined, the user can select the way static assertions are reported. Define
-
-* BOOST_RATIO_USES_STATIC_ASSERT to use Boost.StaticAssert.
-* BOOST_RATIO_USES_MPL_ASSERT to use [*Boost.MPL] static assertions.
-* BOOST_RATIO_USES_RATIO_ASSERT to use __Boost_Ratio static assertions.
-
-The default behavior is as if BOOST_RATIO_USES_ARRAY_ASSERT is defined.
-
-When BOOST_RATIO_USES_MPL_ASSERT is not defined the following symbols are defined as shown:
-
- #define BOOST_RATIO_OVERFLOW_IN_ADD "overflow in ratio add"
- #define BOOST_RATIO_OVERFLOW_IN_SUB "overflow in ratio sub"
- #define BOOST_RATIO_OVERFLOW_IN_MUL "overflow in ratio mul"
- #define BOOST_RATIO_OVERFLOW_IN_DIV "overflow in ratio div"
- #define BOOST_RATIO_NUMERATOR_IS_OUT_OF_RANGE "ratio numerator is out of range"
- #define BOOST_RATIO_DIVIDE_BY_0 "ratio divide by 0"
- #define BOOST_RATIO_DENOMINATOR_IS_OUT_OF_RANGE "ratio denominator is out of range"
-
-Depending upon the static assertion system used, a hint as to the failing assertion will appear in some form in the compiler diagnostic output.
-
-When BOOST_RATIO_EXTENSIONS is defined, __Boost_Ratio provides in addition some extenion to the C++ standard, see below.
-
-
-[endsect]
-
 [section:ratio Class Template `ratio<>`]
 
         template <boost::intmax_t N, boost::intmax_t D>
@@ -756,7 +787,7 @@
             static const boost::intmax_t den;
             typedef ratio<num, den> type;
 
- #ifdef BOOST_RATIO_EXTENSIONS
+ #ifdef __BOOST_RATIO_EXTENSIONS
             typedef mpl::rational_c_tag tag;
             typedef boost::rational<boost::intmax_t> value_type;
             typedef boost::intmax_t num_type;
@@ -790,7 +821,7 @@
 
 [section:ca Construction and Assignment]
 
-Included only if BOOST_RATIO_EXTENSIONS is defined.
+Included only if __BOOST_RATIO_EXTENSIONS is defined.
 
 [heading Default Constructor]
 
@@ -822,7 +853,7 @@
 
 [section:mpl MPL Numeric Metafunctions]
 
-Included only if BOOST_RATIO_EXTENSIONS is defined.
+Included only if __BOOST_RATIO_EXTENSIONS is defined.
 
 In order to work with [*Boost.MPL] numeric metafunctions as a __Rational_Constant, the following has beed added:
 
@@ -834,7 +865,7 @@
 
 [section:obs Observers]
 
-Included only if BOOST_RATIO_EXTENSIONS is defined.
+Included only if __BOOST_RATIO_EXTENSIONS is defined.
 
             static value_type value();
             value_type operator()() const;
@@ -1031,16 +1062,238 @@
 This header provides `ratio_string<>` which can generate a textual representation of a `ratio<>` in the form of a `std::basic_string<>`. These strings can be useful for I/O.
 
     namespace boost {
+ template <class Ratio, class charT> struct ratio_string;
+
+ template <> struct ratio_string<atto, char>;
+ template <> struct ratio_string<atto, char16_t>;
+ template <> struct ratio_string<atto, char32_t>;
+ template <> struct ratio_string<atto, wchar_t>;
+
+ template <> struct ratio_string<femto, char>;
+ template <> struct ratio_string<femto, char16_t>;
+ template <> struct ratio_string<femto, char32_t>;
+ template <> struct ratio_string<femto, wchar_t>;
+
+ template <> struct ratio_string<pico, char>;
+ template <> struct ratio_string<pico, char16_t>;
+ template <> struct ratio_string<pico, char32_t>;
+ template <> struct ratio_string<pico, wchar_t>;
+
+ template <> struct ratio_string<nano, char>;
+ template <> struct ratio_string<nano, char16_t>;
+ template <> struct ratio_string<nano, char32_t>;
+ template <> struct ratio_string<nano, wchar_t>;
+
+ template <> struct ratio_string<micro, char>;
+ template <> struct ratio_string<micro, char16_t>;
+ template <> struct ratio_string<micro, char32_t>;
+ template <> struct ratio_string<micro, wchar_t>;
+
+ template <> struct ratio_string<milli, char>;
+ template <> struct ratio_string<milli, char16_t>;
+ template <> struct ratio_string<milli, char32_t>;
+ template <> struct ratio_string<milli, wchar_t>;
+
+ template <> struct ratio_string<centi, char>;
+ template <> struct ratio_string<centi, char16_t>;
+ template <> struct ratio_string<centi, char32_t>;
+ template <> struct ratio_string<centi, wchar_t>;
+
+ template <> struct ratio_string<deci, char>;
+ template <> struct ratio_string<deci, char16_t>;
+ template <> struct ratio_string<deci, char32_t>;
+ template <> struct ratio_string<deci, wchar_t>;
+
+ template <> struct ratio_string<deca, char>;
+ template <> struct ratio_string<deca, char16_t>;
+ template <> struct ratio_string<deca, char32_t>;
+ template <> struct ratio_string<deca, wchar_t>;
+
+ template <> struct ratio_string<hecto, char>;
+ template <> struct ratio_string<hecto, char16_t>;
+ template <> struct ratio_string<hecto, char32_t>;
+ template <> struct ratio_string<hecto, wchar_t>;
+
+ template <> struct ratio_string<kilo, char>;
+ template <> struct ratio_string<kilo, char16_t>;
+ template <> struct ratio_string<kilo, char32_t>;
+ template <> struct ratio_string<kilo, wchar_t>;
+
+ template <> struct ratio_string<mega, char>;
+ template <> struct ratio_string<mega, char16_t>;
+ template <> struct ratio_string<mega, char32_t>;
+ template <> struct ratio_string<mega, wchar_t>;
+
+ template <> struct ratio_string<giga, char>;
+ template <> struct ratio_string<giga, char16_t>;
+ template <> struct ratio_string<giga, char32_t>;
+ template <> struct ratio_string<giga, wchar_t>;
+
+ template <> struct ratio_string<tera, char>;
+ template <> struct ratio_string<tera, char16_t>;
+ template <> struct ratio_string<tera, char32_t>;
+ template <> struct ratio_string<tera, wchar_t>;
+
+ template <> struct ratio_string<peta, char>;
+ template <> struct ratio_string<peta, char16_t>;
+ template <> struct ratio_string<peta, char32_t>;
+ template <> struct ratio_string<peta, wchar_t>;
+
+ template <> struct ratio_string<exa, char>;
+ template <> struct ratio_string<exa, char16_t>;
+ template <> struct ratio_string<exa, char32_t>;
+ template <> struct ratio_string<exa, wchar_t>;
+ }
+
+[section:ratio_string Template Class `ratio_string<>`]
+
         template <class Ratio, class CharT>
         struct ratio_string
         {
- static std::basic_string<CharT> short_name();
- static std::basic_string<CharT> long_name();
+ static std::basic_string<CharT> symbol();
+ static std::basic_string<CharT> prefix();
+ static std::basic_string<CharT> short_name(); // DEPRECATED V2
+ static std::basic_string<CharT> long_name(); // DEPRECATED V2
         };
- }
+
+The class template ratio_string provides textual representations of the associated ratio appropriate for the character type charT.
+
+The primary template provides generic strings. Specializations provide the same static member functions but these functions return the English SI prefix and symbol names as specified by the General Conference on Weights and Measures.
+
+[section:prefix Static Member function `prefix()`]
+
+ template<class Ratio, class CharT>
+ basic_string<charT>
+ ratio_string<Ratio, CharT>::prefix();
+
+[*Returns]: A basic_string of the form: [Ratio::num/Ratio::den]
+
+[*Example]: `ratio_string<ratio<2, 60>, wchar_t>::prefix()` returns `L"[1/30]"`.
+
+[endsect]
+
+[section:symbol Static Member function `symbol()`]
+
+ template<class Ratio, class CharT>
+ basic_string<charT>
+ ratio_string<Ratio, CharT>::symbol();
+
+[*Returns]: prefix().
+
+
+[endsect]
+[section:long_name Static Member function `long_name()` DEPRECATED V2]
+
+ template<class Ratio, class CharT>
+ basic_string<charT>
+ ratio_string<Ratio, CharT>::long_name();
+
+[*Returns]: prefix().
+
+[endsect]
+[section:short_name Static Member function `short_name()` DEPRECATED V2]
+
+ template<class Ratio, class CharT>
+ basic_string<charT>
+ ratio_string<Ratio, CharT>::short_name();
+
+[*Returns]: symbol().
 
 [endsect]
 [endsect]
+
+
+[section:spe Specializations for `ratio_string<>`]
+
+For each specialization the table gives the return value for `prefix()` and `symbol()`.
+
+[table The return values of specializations of ratio_string
+ [[Specialization][`prefix()`] [`symbol()`]]
+ [[`ratio_string<atto, char>`][`"atto"`] [`"a"`]]
+ [[`ratio_string<atto, char16_t>`][`u"atto"`] [`u"a"`]]
+ [[`ratio_string<atto, char32_t>`][`U"atto"`] [`U"a"`]]
+ [[`ratio_string<atto, wchar_t>`][`L"atto"`] [`L"a"`]]
+
+ [[`ratio_string<femto, char>`][`"femto"`] [`"f"`]]
+ [[`ratio_string<femto, char16_t>`][`u"femto"`] [`u"f"`]]
+ [[`ratio_string<femto, char32_t>`][`U"femto"`] [`U"f"`]]
+ [[`ratio_string<femto, wchar_t>`][`L"femto"`] [`L"f"`]]
+
+ [[`ratio_string<pico, char>`][`"pico"`] [`"p"`]]
+ [[`ratio_string<pico, char16_t>`][`u"pico"`] [`u"p"`]]
+ [[`ratio_string<pico, char32_t>`][`U"pico"`] [`U"p"`]]
+ [[`ratio_string<pico, wchar_t>`][`L"pico"`] [`L"p"`]]
+
+ [[`ratio_string<nano, char>`][`"nano"`] [`"a"`]]
+ [[`ratio_string<nano, char16_t>`][`u"nano"`] [`u"a"`]]
+ [[`ratio_string<nano, char32_t>`][`U"nano"`] [`U"a"`]]
+ [[`ratio_string<nano, wchar_t>`][`L"nano"`] [`L"a"`]]
+
+ [[`ratio_string<micro, char>`][`"micro"`] [`u8"\u00B5"`]]
+ [[`ratio_string<micro, char16_t>`][`u"micro"`] [`u"\u00B5"`]]
+ [[`ratio_string<micro, char32_t>`][`U"micro"`] [`U"\u00B5"`]]
+ [[`ratio_string<micro, wchar_t>`][`L"micro"`] [`Lu8"\u00B5"`]]
+
+ [[`ratio_string<milli, char>`][`"milli"`] [`"m"`]]
+ [[`ratio_string<milli, char16_t>`][`u"milli"`] [`u"m"`]]
+ [[`ratio_string<milli, char32_t>`][`U"milli"`] [`U"m"`]]
+ [[`ratio_string<milli, wchar_t>`][`L"milli"`] [`L"m"`]]
+
+ [[`ratio_string<centi, char>`][`"centi"`] [`"c"`]]
+ [[`ratio_string<centi, char16_t>`][`u"centi"`] [`u"c"`]]
+ [[`ratio_string<centi, char32_t>`][`U"centi"`] [`U"c"`]]
+ [[`ratio_string<centi, wchar_t>`][`L"centi"`] [`L"c"`]]
+
+ [[`ratio_string<deci, char>`][`"deci"`] [`"d"`]]
+ [[`ratio_string<deci, char16_t>`][`u"deci"`] [`u"d"`]]
+ [[`ratio_string<deci, char32_t>`][`U"deci"`] [`U"d"`]]
+ [[`ratio_string<deci, wchar_t>`][`L"deci"`] [`L"d"`]]
+
+ [[`ratio_string<deca, char>`][`"deca"`] [`"da"`]]
+ [[`ratio_string<deca, char16_t>`][`u"deca"`] [`u"da"`]]
+ [[`ratio_string<deca, char32_t>`][`U"deca"`] [`U"da"`]]
+ [[`ratio_string<deca, wchar_t>`][`L"deca"`] [`L"da"`]]
+
+ [[`ratio_string<hecto, char>`][`"hecto"`] [`"h"`]]
+ [[`ratio_string<hecto, char16_t>`][`u"hecto"`] [`u"h"`]]
+ [[`ratio_string<hecto, char32_t>`][`U"hecto"`] [`U"h"`]]
+ [[`ratio_string<hecto, wchar_t>`][`L"hecto"`] [`L"h"`]]
+
+ [[`ratio_string<kilo, char>`][`"kilo"`] [`"k"`]]
+ [[`ratio_string<kilo, char16_t>`][`u"kilo"`] [`u"k"`]]
+ [[`ratio_string<kilo, char32_t>`][`U"kilo"`] [`U"k"`]]
+ [[`ratio_string<kilo, wchar_t>`][`L"kilo"`] [`L"k"`]]
+
+ [[`ratio_string<mega, char>`][`"mega"`] [`"M"`]]
+ [[`ratio_string<mega, char16_t>`][`u"mega"`] [`u"M"`]]
+ [[`ratio_string<mega, char32_t>`][`U"mega"`] [`U"M"`]]
+ [[`ratio_string<mega, wchar_t>`][`L"mega"`] [`L"M"`]]
+
+ [[`ratio_string<giga, char>`][`"giga"`] [`"G"`]]
+ [[`ratio_string<giga, char16_t>`][`u"giga"`] [`u"G"`]]
+ [[`ratio_string<giga, char32_t>`][`U"giga"`] [`U"G"`]]
+ [[`ratio_string<giga, wchar_t>`][`L"giga"`] [`L"G"`]]
+
+ [[`ratio_string<tera, char>`][`"tera"`] [`"T"`]]
+ [[`ratio_string<tera, char16_t>`][`u"tera"`] [`u"T"`]]
+ [[`ratio_string<tera, char32_t>`][`U"tera"`] [`U"T"`]]
+ [[`ratio_string<tera, wchar_t>`][`L"tera"`] [`L"T"`]]
+
+ [[`ratio_string<peta, char>`][`"peta"`] [`"P"`]]
+ [[`ratio_string<peta, char16_t>`][`u"peta"`] [`u"P"`]]
+ [[`ratio_string<peta, char32_t>`][`U"peta"`] [`U"P"`]]
+ [[`ratio_string<peta, wchar_t>`][`L"peta"`] [`L"P"`]]
+
+ [[`ratio_string<exa, char>`][`"exa"`] [`"E"`]]
+ [[`ratio_string<exa, char16_t>`][`u"exa"`] [`u"E"`]]
+ [[`ratio_string<exa, char32_t>`][`U"exa"`] [`U"E"`]]
+ [[`ratio_string<exa, wchar_t>`][`L"exa"`] [`L"E"`]]
+
+]
+
+[endsect]
+[endsect]
+[endsect]
 [section:mpl Rational Constant]
 
 [/===========================================]
@@ -1596,6 +1849,18 @@
 [section:history Appendix A: History]
 [/==================================]
 
+[section [*Version 2.0.0, November 1, 2012 - 1.52] ]
+
+[*Features:]
+
+* [@http://svn.boost.org/trac/boost/ticket/XXXX #XXXX] Replace the short_name and long_name functions by symbol and prefix functions respectively.
+
+[*Deprecated:]
+
+The ratio_string<>::short_name and ratio_string<>::long_name are deprecated. Use ratio_string<>::symbol and ratio_string<>::prefix respectively. These functions be removed in 1.55.
+
+[endsect]
+
 [section [*Version 1.0.3, August 1, 2012 - 1.51] ]
 
 [*Fixes:]

Modified: trunk/libs/ratio/example/display_ex.cpp
==============================================================================
--- trunk/libs/ratio/example/display_ex.cpp (original)
+++ trunk/libs/ratio/example/display_ex.cpp 2012-08-30 01:00:10 EDT (Thu, 30 Aug 2012)
@@ -19,21 +19,21 @@
     using namespace std;
     using namespace boost;
 
- cout << "ratio_string<deca, char>::long_name() = "
- << ratio_string<boost::deca, char>::long_name() << '\n';
- cout << "ratio_string<deca, char>::short_name() = "
- << ratio_string<boost::deca, char>::short_name() << '\n';
+ cout << "ratio_string<deca, char>::prefix() = "
+ << ratio_string<boost::deca, char>::prefix() << '\n';
+ cout << "ratio_string<deca, char>::symbol() = "
+ << ratio_string<boost::deca, char>::symbol() << '\n';
 
- cout << "ratio_string<giga, char>::long_name() = "
- << ratio_string<boost::giga, char>::long_name() << '\n';
- cout << "ratio_string<giga, char>::short_name() = "
- << ratio_string<boost::giga, char>::short_name() << '\n';
+ cout << "ratio_string<giga, char>::prefix() = "
+ << ratio_string<boost::giga, char>::prefix() << '\n';
+ cout << "ratio_string<giga, char>::symbol() = "
+ << ratio_string<boost::giga, char>::symbol() << '\n';
+
+ cout << "ratio_string<ratio<4, 6>, char>::prefix() = "
+ << ratio_string<boost::ratio<4, 6>, char>::prefix() << '\n';
+ cout << "ratio_string<ratio<4, 6>, char>::symbol() = "
+ << ratio_string<boost::ratio<4, 6>, char>::symbol() << '\n';
 
- cout << "ratio_string<ratio<4, 6>, char>::long_name() = "
- << ratio_string<boost::ratio<4, 6>, char>::long_name() << '\n';
- cout << "ratio_string<ratio<4, 6>, char>::short_name() = "
- << ratio_string<boost::ratio<4, 6>, char>::short_name() << '\n';
-
     return 0;
 }
 

Modified: trunk/libs/ratio/test/Jamfile.v2
==============================================================================
--- trunk/libs/ratio/test/Jamfile.v2 (original)
+++ trunk/libs/ratio/test/Jamfile.v2 2012-08-30 01:00:10 EDT (Thu, 30 Aug 2012)
@@ -26,6 +26,7 @@
         <toolset>msvc:<asynch-exceptions>on
         <define>BOOST_ENABLE_WARNINGS
         <define>BOOST_RATIO_USES_MPL_ASSERT
+ <define>BOOST_RATIO_VERSION=2
         <define>BOOST_MPL_NEXT_PRIOR_EXT
         #<toolset>sun:<define>BOOST_COMMON_TYPE_DONT_USE_TYPEOF
         #<toolset>sun:<define>BOOST_TYPEOF_EMULATION

Modified: trunk/libs/ratio/test/ratio_io/ratio_io_fail.cpp
==============================================================================
--- trunk/libs/ratio/test/ratio_io/ratio_io_fail.cpp (original)
+++ trunk/libs/ratio/test/ratio_io/ratio_io_fail.cpp 2012-08-30 01:00:10 EDT (Thu, 30 Aug 2012)
@@ -17,6 +17,6 @@
 typedef boost::ratio_string<int, char> R1;
 
 void test() {
-
- std::string str = R1::short_name();
+
+ std::string str = R1::symbol();
 }

Modified: trunk/libs/ratio/test/ratio_io/ratio_io_pass.cpp
==============================================================================
--- trunk/libs/ratio/test/ratio_io/ratio_io_pass.cpp (original)
+++ trunk/libs/ratio/test/ratio_io/ratio_io_pass.cpp 2012-08-30 01:00:10 EDT (Thu, 30 Aug 2012)
@@ -22,130 +22,130 @@
 
     {
         BOOST_TEST((
- boost::ratio_string<boost::atto, char>::long_name() == "atto"
+ boost::ratio_string<boost::atto, char>::prefix() == "atto"
         ));
         BOOST_TEST((
- boost::ratio_string<boost::atto, char>::short_name() == "a"
+ boost::ratio_string<boost::atto, char>::symbol() == "a"
         ));
     }
     {
         BOOST_TEST((
- boost::ratio_string<boost::femto, char>::long_name() == "femto"
+ boost::ratio_string<boost::femto, char>::prefix() == "femto"
         ));
         BOOST_TEST((
- boost::ratio_string<boost::femto, char>::short_name() == "f"
+ boost::ratio_string<boost::femto, char>::symbol() == "f"
         ));
     }
     {
         BOOST_TEST((
- boost::ratio_string<boost::pico, char>::long_name() == "pico"
+ boost::ratio_string<boost::pico, char>::prefix() == "pico"
         ));
         BOOST_TEST((
- boost::ratio_string<boost::pico, char>::short_name() == "p"
+ boost::ratio_string<boost::pico, char>::symbol() == "p"
         ));
     }
     {
         BOOST_TEST((
- boost::ratio_string<boost::nano, char>::long_name() == "nano"
+ boost::ratio_string<boost::nano, char>::prefix() == "nano"
         ));
         BOOST_TEST((
- boost::ratio_string<boost::nano, char>::short_name() == "n"
+ boost::ratio_string<boost::nano, char>::symbol() == "n"
         ));
     }
     {
         BOOST_TEST((
- boost::ratio_string<boost::micro, char>::long_name() == "micro"
+ boost::ratio_string<boost::micro, char>::prefix() == "micro"
         ));
         BOOST_TEST((
- boost::ratio_string<boost::micro, char>::short_name() == "\xC2\xB5"
+ boost::ratio_string<boost::micro, char>::symbol() == "\xC2\xB5"
         ));
     }
     {
         BOOST_TEST((
- boost::ratio_string<boost::milli, char>::long_name() == "milli"
+ boost::ratio_string<boost::milli, char>::prefix() == "milli"
         ));
         BOOST_TEST((
- boost::ratio_string<boost::milli, char>::short_name() == "m"
+ boost::ratio_string<boost::milli, char>::symbol() == "m"
         ));
     }
     {
         BOOST_TEST((
- boost::ratio_string<boost::centi, char>::long_name() == "centi"
+ boost::ratio_string<boost::centi, char>::prefix() == "centi"
         ));
         BOOST_TEST((
- boost::ratio_string<boost::centi, char>::short_name() == "c"
+ boost::ratio_string<boost::centi, char>::symbol() == "c"
         ));
     }
     {
         BOOST_TEST((
- boost::ratio_string<boost::deci, char>::long_name() == "deci"
+ boost::ratio_string<boost::deci, char>::prefix() == "deci"
         ));
         BOOST_TEST((
- boost::ratio_string<boost::deci, char>::short_name() == "d"
+ boost::ratio_string<boost::deci, char>::symbol() == "d"
         ));
     }
     {
         BOOST_TEST((
- boost::ratio_string<boost::deca, char>::long_name() == "deca"
+ boost::ratio_string<boost::deca, char>::prefix() == "deca"
         ));
         BOOST_TEST((
- boost::ratio_string<boost::deca, char>::short_name() == "da"
+ boost::ratio_string<boost::deca, char>::symbol() == "da"
         ));
     }
     {
         BOOST_TEST((
- boost::ratio_string<boost::hecto, char>::long_name() == "hecto"
+ boost::ratio_string<boost::hecto, char>::prefix() == "hecto"
         ));
         BOOST_TEST((
- boost::ratio_string<boost::hecto, char>::short_name() == "h"
+ boost::ratio_string<boost::hecto, char>::symbol() == "h"
         ));
     }
     {
         BOOST_TEST((
- boost::ratio_string<boost::kilo, char>::long_name() == "kilo"
+ boost::ratio_string<boost::kilo, char>::prefix() == "kilo"
         ));
         BOOST_TEST((
- boost::ratio_string<boost::kilo, char>::short_name() == "k"
+ boost::ratio_string<boost::kilo, char>::symbol() == "k"
         ));
     }
     {
         BOOST_TEST((
- boost::ratio_string<boost::mega, char>::long_name() == "mega"
+ boost::ratio_string<boost::mega, char>::prefix() == "mega"
         ));
         BOOST_TEST((
- boost::ratio_string<boost::mega, char>::short_name() == "M"
+ boost::ratio_string<boost::mega, char>::symbol() == "M"
         ));
     }
     {
         BOOST_TEST((
- boost::ratio_string<boost::giga, char>::long_name() == "giga"
+ boost::ratio_string<boost::giga, char>::prefix() == "giga"
         ));
         BOOST_TEST((
- boost::ratio_string<boost::giga, char>::short_name() == "G"
+ boost::ratio_string<boost::giga, char>::symbol() == "G"
         ));
     }
     {
         BOOST_TEST((
- boost::ratio_string<boost::tera, char>::long_name() == "tera"
+ boost::ratio_string<boost::tera, char>::prefix() == "tera"
         ));
         BOOST_TEST((
- boost::ratio_string<boost::tera, char>::short_name() == "T"
+ boost::ratio_string<boost::tera, char>::symbol() == "T"
         ));
     }
     {
         BOOST_TEST((
- boost::ratio_string<boost::peta, char>::long_name() == "peta"
+ boost::ratio_string<boost::peta, char>::prefix() == "peta"
         ));
         BOOST_TEST((
- boost::ratio_string<boost::peta, char>::short_name() == "P"
+ boost::ratio_string<boost::peta, char>::symbol() == "P"
         ));
     }
     {
         BOOST_TEST((
- boost::ratio_string<boost::exa, char>::long_name() == "exa"
+ boost::ratio_string<boost::exa, char>::prefix() == "exa"
         ));
         BOOST_TEST((
- boost::ratio_string<boost::exa, char>::short_name() == "E"
+ boost::ratio_string<boost::exa, char>::symbol() == "E"
         ));
     }
 // return 1;


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