|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r66448 - sandbox/chrono/boost/ratio
From: vicente.botet_at_[hidden]
Date: 2010-11-07 17:08:07
Author: viboes
Date: 2010-11-07 17:08:05 EST (Sun, 07 Nov 2010)
New Revision: 66448
URL: http://svn.boost.org/trac/boost/changeset/66448
Log:
Ratio: Add static_string
Added:
sandbox/chrono/boost/ratio/ratio_static_string.hpp (contents, props changed)
Text files modified:
sandbox/chrono/boost/ratio/ratio_io.hpp | 191 +++++++++++++++++++++++++++++++++++----
1 files changed, 168 insertions(+), 23 deletions(-)
Modified: sandbox/chrono/boost/ratio/ratio_io.hpp
==============================================================================
--- sandbox/chrono/boost/ratio/ratio_io.hpp (original)
+++ sandbox/chrono/boost/ratio/ratio_io.hpp 2010-11-07 17:08:05 EST (Sun, 07 Nov 2010)
@@ -19,7 +19,7 @@
#include <ratio>
#include <string>
-namespace std
+namespace boost
{
template <class Ratio, class CharT>
@@ -29,23 +29,26 @@
static basic_string<CharT> long_name();
};
-} // std
+} // boost
*/
-#include <boost/ratio.hpp>
#include <boost/config.hpp>
+#include <boost/ratio.hpp>
#include <string>
#include <sstream>
+#include <boost/ratio/ratio_static_string.hpp>
+#include <boost/static_string/static_string.hpp>
#if defined(BOOST_NO_UNICODE_LITERALS) || defined(BOOST_NO_CHAR16_T) || defined(BOOST_NO_CHAR32_T)
-//~ #define BOOST_HAS_UNICODE_SUPPORT
+//~ #define BOOST_RATIO_HAS_UNICODE_SUPPORT
#else
-#define BOOST_HAS_UNICODE_SUPPORT 1
+#define BOOST_RATIO_HAS_UNICODE_SUPPORT 1
#endif
+
namespace boost {
-
+
template <class Ratio, class CharT>
struct ratio_string
{
@@ -62,9 +65,32 @@
<< Ratio::den << CharT(']');
return os.str();
}
-
+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);
+ }
+};
+}
// atto
+#if 1
+template <typename CharT>
+struct ratio_string<atto, CharT> :
+ ratio_detail::ratio_string_static<atto,CharT>
+{};
+#else
template <>
struct ratio_string<atto, char>
{
@@ -72,7 +98,7 @@
static std::string long_name() {return std::string("atto");}
};
-#if BOOST_HAS_UNICODE_SUPPORT
+#if BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<atto, char16_t>
@@ -98,9 +124,17 @@
static std::wstring long_name() {return std::wstring(L"atto");}
};
#endif
+#endif
// femto
+#if 1
+template <typename CharT>
+struct ratio_string<femto, CharT> :
+ ratio_detail::ratio_string_static<femto,CharT>
+{};
+
+#else
template <>
struct ratio_string<femto, char>
{
@@ -108,7 +142,7 @@
static std::string long_name() {return std::string("femto");}
};
-#if BOOST_HAS_UNICODE_SUPPORT
+#if BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<femto, char16_t>
@@ -134,9 +168,17 @@
static std::wstring long_name() {return std::wstring(L"femto");}
};
#endif
+#endif
// pico
+#if 1
+template <typename CharT>
+struct ratio_string<pico, CharT> :
+ ratio_detail::ratio_string_static<pico,CharT>
+{};
+
+#else
template <>
struct ratio_string<pico, char>
{
@@ -144,7 +186,7 @@
static std::string long_name() {return std::string("pico");}
};
-#if BOOST_HAS_UNICODE_SUPPORT
+#if BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<pico, char16_t>
@@ -170,9 +212,17 @@
static std::wstring long_name() {return std::wstring(L"pico");}
};
#endif
+#endif
// nano
+#if 1
+template <typename CharT>
+struct ratio_string<nano, CharT> :
+ ratio_detail::ratio_string_static<nano,CharT>
+{};
+
+#else
template <>
struct ratio_string<nano, char>
{
@@ -180,7 +230,7 @@
static std::string long_name() {return std::string("nano");}
};
-#if BOOST_HAS_UNICODE_SUPPORT
+#if BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<nano, char16_t>
@@ -206,9 +256,17 @@
static std::wstring long_name() {return std::wstring(L"nano");}
};
#endif
+#endif
// micro
+#if 1
+template <typename CharT>
+struct ratio_string<micro, CharT> :
+ ratio_detail::ratio_string_static<micro,CharT>
+{};
+
+#else
template <>
struct ratio_string<micro, char>
{
@@ -216,7 +274,7 @@
static std::string long_name() {return std::string("micro");}
};
-#if BOOST_HAS_UNICODE_SUPPORT
+#if BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<micro, char16_t>
@@ -242,9 +300,17 @@
static std::wstring long_name() {return std::wstring(L"micro");}
};
#endif
+#endif
// milli
+#if 1
+template <typename CharT>
+struct ratio_string<milli, CharT> :
+ ratio_detail::ratio_string_static<milli,CharT>
+{};
+
+#else
template <>
struct ratio_string<milli, char>
{
@@ -252,7 +318,7 @@
static std::string long_name() {return std::string("milli");}
};
-#if BOOST_HAS_UNICODE_SUPPORT
+#if BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<milli, char16_t>
@@ -278,9 +344,17 @@
static std::wstring long_name() {return std::wstring(L"milli");}
};
#endif
+#endif
// centi
+#if 1
+template <typename CharT>
+struct ratio_string<centi, CharT> :
+ ratio_detail::ratio_string_static<centi,CharT>
+{};
+
+#else
template <>
struct ratio_string<centi, char>
{
@@ -288,7 +362,7 @@
static std::string long_name() {return std::string("centi");}
};
-#if BOOST_HAS_UNICODE_SUPPORT
+#if BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<centi, char16_t>
@@ -314,8 +388,16 @@
static std::wstring long_name() {return std::wstring(L"centi");}
};
#endif
+#endif
// deci
+#if 1
+template <typename CharT>
+struct ratio_string<deci, CharT> :
+ ratio_detail::ratio_string_static<deci,CharT>
+{};
+
+#else
template <>
struct ratio_string<deci, char>
@@ -324,7 +406,7 @@
static std::string long_name() {return std::string("deci");}
};
-#if BOOST_HAS_UNICODE_SUPPORT
+#if BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<deci, char16_t>
@@ -350,9 +432,17 @@
static std::wstring long_name() {return std::wstring(L"deci");}
};
#endif
+#endif
// deca
+#if 1
+template <typename CharT>
+struct ratio_string<deca, CharT> :
+ ratio_detail::ratio_string_static<deca,CharT>
+{};
+
+#else
template <>
struct ratio_string<deca, char>
{
@@ -360,7 +450,7 @@
static std::string long_name() {return std::string("deca");}
};
-#if BOOST_HAS_UNICODE_SUPPORT
+#if BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<deca, char16_t>
@@ -386,9 +476,17 @@
static std::wstring long_name() {return std::wstring(L"deca");}
};
#endif
+#endif
// hecto
+#if 1
+template <typename CharT>
+struct ratio_string<hecto, CharT> :
+ ratio_detail::ratio_string_static<hecto,CharT>
+{};
+
+#else
template <>
struct ratio_string<hecto, char>
{
@@ -396,7 +494,7 @@
static std::string long_name() {return std::string("hecto");}
};
-#if BOOST_HAS_UNICODE_SUPPORT
+#if BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<hecto, char16_t>
@@ -422,9 +520,17 @@
static std::wstring long_name() {return std::wstring(L"hecto");}
};
#endif
+#endif
// kilo
+#if 1
+template <typename CharT>
+struct ratio_string<kilo, CharT> :
+ ratio_detail::ratio_string_static<kilo,CharT>
+{};
+
+#else
template <>
struct ratio_string<kilo, char>
{
@@ -432,7 +538,7 @@
static std::string long_name() {return std::string("kilo");}
};
-#if BOOST_HAS_UNICODE_SUPPORT
+#if BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<kilo, char16_t>
@@ -458,9 +564,18 @@
static std::wstring long_name() {return std::wstring(L"kilo");}
};
#endif
+#endif
// mega
+#if 1
+template <typename CharT>
+struct ratio_string<mega, CharT> :
+ ratio_detail::ratio_string_static<mega,CharT>
+{};
+
+#else
+
template <>
struct ratio_string<mega, char>
{
@@ -468,7 +583,7 @@
static std::string long_name() {return std::string("mega");}
};
-#if BOOST_HAS_UNICODE_SUPPORT
+#if BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<mega, char16_t>
@@ -494,8 +609,16 @@
static std::wstring long_name() {return std::wstring(L"mega");}
};
#endif
+#endif
// giga
+#if 1
+template <typename CharT>
+struct ratio_string<giga, CharT> :
+ ratio_detail::ratio_string_static<giga,CharT>
+{};
+
+#else
template <>
struct ratio_string<giga, char>
@@ -504,7 +627,7 @@
static std::string long_name() {return std::string("giga");}
};
-#if BOOST_HAS_UNICODE_SUPPORT
+#if BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<giga, char16_t>
@@ -530,9 +653,16 @@
static std::wstring long_name() {return std::wstring(L"giga");}
};
#endif
+#endif
// tera
+#if 1
+template <typename CharT>
+struct ratio_string<tera, CharT> :
+ ratio_detail::ratio_string_static<tera,CharT>
+{};
+#else
template <>
struct ratio_string<tera, char>
{
@@ -540,7 +670,7 @@
static std::string long_name() {return std::string("tera");}
};
-#if BOOST_HAS_UNICODE_SUPPORT
+#if BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<tera, char16_t>
@@ -566,9 +696,16 @@
static std::wstring long_name() {return std::wstring(L"tera");}
};
#endif
+#endif
// peta
+#if 1
+template <typename CharT>
+struct ratio_string<peta, CharT> :
+ ratio_detail::ratio_string_static<peta,CharT>
+{};
+#else
template <>
struct ratio_string<peta, char>
{
@@ -576,7 +713,7 @@
static std::string long_name() {return std::string("peta");}
};
-#if BOOST_HAS_UNICODE_SUPPORT
+#if BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<peta, char16_t>
@@ -602,9 +739,16 @@
static std::wstring long_name() {return std::wstring(L"peta");}
};
#endif
+#endif
// exa
+#if 1
+template <typename CharT>
+struct ratio_string<exa, CharT> :
+ ratio_detail::ratio_string_static<exa,CharT>
+{};
+#else
template <>
struct ratio_string<exa, char>
{
@@ -612,7 +756,7 @@
static std::string long_name() {return std::string("exa");}
};
-#if BOOST_HAS_UNICODE_SUPPORT
+#if BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<exa, char16_t>
@@ -638,6 +782,7 @@
static std::wstring long_name() {return std::wstring(L"exa");}
};
#endif
+#endif
}
Added: sandbox/chrono/boost/ratio/ratio_static_string.hpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/boost/ratio/ratio_static_string.hpp 2010-11-07 17:08:05 EST (Sun, 07 Nov 2010)
@@ -0,0 +1,631 @@
+// ratio_io
+//
+// (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_RATIO_STATIC_STRING_HPP
+#define BOOST_RATIO_RATIO_STATIC_STRING_HPP
+
+/*
+
+ ratio_static_string synopsis
+
+#include <ratio>
+#include <string>
+
+namespace boost
+{
+
+template <class Ratio, class CharT>
+struct ratio_static_string
+{
+ typedef basic_str<CharT, ...> short_name;
+ typedef basic_str<CharT, ...> long_name;
+};
+
+} // boost
+
+*/
+
+#include <boost/config.hpp>
+#include <boost/ratio.hpp>
+#include <boost/static_string/basic_str.hpp>
+//#include <sstream>
+
+
+#if defined(BOOST_NO_UNICODE_LITERALS) || defined(BOOST_NO_CHAR16_T) || defined(BOOST_NO_CHAR32_T)
+//~ #define BOOST_RATIO_HAS_UNICODE_SUPPORT
+#else
+#define BOOST_RATIO_HAS_UNICODE_SUPPORT 1
+#endif
+
+namespace boost {
+
+template <class Ratio, class CharT>
+struct ratio_static_string;
+
+
+// atto
+
+template <>
+struct ratio_static_string<atto, char>
+{
+ typedef static_string::str_1<'a'>::type short_name;
+ typedef static_string::str_4<'a','t','t','o'>::type long_name;
+};
+
+#ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT
+
+template <>
+struct ratio_static_string<atto, char16_t>
+{
+ typedef static_string::u16str_1<u'a'>::type short_name;
+ typedef static_string::u16str_4<u'a',u't',u't',u'o'>::type long_name;
+};
+
+template <>
+struct ratio_static_string<atto, char32_t>
+{
+ typedef static_string::u32str_1<U'a'>::type short_name;
+ typedef static_string::u32str_4<U'a',U't',U't',U'o'>::type long_name;
+};
+
+#endif
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_static_string<atto, wchar_t>
+{
+ typedef static_string::wstr_1<L'a'>::type short_name;
+ typedef static_string::wstr_4<L'a',L't',L't',L'o'>::type long_name;
+};
+#endif
+
+// femto
+
+template <>
+struct ratio_static_string<femto, char>
+{
+ typedef static_string::str_1<'f'>::type short_name;
+ typedef static_string::str_5<'f','e','m','t','o'>::type long_name;
+};
+
+#ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT
+
+template <>
+struct ratio_static_string<femto, char16_t>
+{
+ typedef static_string::u16str_1<u'f'>::type short_name;
+ typedef static_string::u16str_5<u'f',u'e',u'm',u't',u'o'>::type long_name;
+};
+
+template <>
+struct ratio_static_string<femto, char32_t>
+{
+ typedef static_string::u32str_1<U'f'>::type short_name;
+ typedef static_string::u32str_5<U'f',U'e',U'm',U't',U'o'>::type long_name;
+};
+
+#endif
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_static_string<femto, wchar_t>
+{
+ typedef static_string::wstr_1<L'f'>::type short_name;
+ typedef static_string::wstr_5<L'f',L'e',L'm',L't',L'o'>::type long_name;
+};
+#endif
+
+// pico
+
+template <>
+struct ratio_static_string<pico, char>
+{
+ typedef static_string::str_1<'p'>::type short_name;
+ typedef static_string::str_4<'p','i','c','o'>::type long_name;
+};
+
+#ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT
+
+template <>
+struct ratio_static_string<pico, char16_t>
+{
+ typedef static_string::u16str_1<u'p'>::type short_name;
+ typedef static_string::u16str_4<u'p',u'i',u'c',u'o'>::type long_name;
+};
+
+template <>
+struct ratio_static_string<pico, char32_t>
+{
+ typedef static_string::u32str_1<U'p'>::type short_name;
+ typedef static_string::u32str_4<U'p',U'i',U'c',U'o'>::type long_name;
+};
+
+#endif
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_static_string<pico, wchar_t>
+{
+ typedef static_string::wstr_1<L'p'>::type short_name;
+ typedef static_string::wstr_4<L'p',L'i',L'c',L'o'>::type long_name;
+};
+#endif
+
+// nano
+
+template <>
+struct ratio_static_string<nano, char>
+{
+ typedef static_string::str_1<'n'>::type short_name;
+ typedef static_string::str_4<'n','a','n','o'>::type long_name;
+};
+
+#ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT
+
+template <>
+struct ratio_static_string<nano, char16_t>
+{
+ typedef static_string::u16str_1<u'n'>::type short_name;
+ typedef static_string::u16str_4<u'n',u'a',u'n',u'o'>::type long_name;
+};
+
+template <>
+struct ratio_static_string<nano, char32_t>
+{
+ typedef static_string::u32str_1<U'n'>::type short_name;
+ typedef static_string::u32str_4<U'n',U'a',U'n',U'o'>::type long_name;
+};
+
+#endif
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_static_string<nano, wchar_t>
+{
+ typedef static_string::wstr_1<L'n'>::type short_name;
+ typedef static_string::wstr_4<L'n',L'a',L'n',L'o'>::type long_name;
+};
+#endif
+
+// micro
+
+template <>
+struct ratio_static_string<micro, char>
+{
+ typedef static_string::str_2<'\xC2','\xB5'>::type short_name;
+ typedef static_string::str_5<'m','i','c','r','o'>::type long_name;
+};
+
+#ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT
+
+template <>
+struct ratio_static_string<micro, char16_t>
+{
+ typedef static_string::u16str_1<u'\xB5'>::type short_name;
+ typedef static_string::u16str_5<u'm',u'i',u'c',u'r',u'o'>::type long_name;
+};
+
+template <>
+struct ratio_static_string<micro, char32_t>
+{
+ typedef static_string::u32str_1<U'\xB5'>::type short_name;
+ typedef static_string::u32str_5<U'm',U'i',U'c',U'r',U'o'>::type long_name;
+};
+
+#endif
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_static_string<micro, wchar_t>
+{
+ typedef static_string::wstr_1<L'\xB5'>::type short_name;
+ typedef static_string::wstr_5<L'm',L'i',L'c',L'r',L'o'>::type long_name;
+};
+#endif
+
+// milli
+
+template <>
+struct ratio_static_string<milli, char>
+{
+ typedef static_string::str_1<'m'>::type short_name;
+ typedef static_string::str_5<'m','i','l','l','i'>::type long_name;
+};
+
+#ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT
+
+template <>
+struct ratio_static_string<milli, char16_t>
+{
+ typedef static_string::u16str_1<u'm'>::type short_name;
+ typedef static_string::u16str_5<u'm',u'i',u'l',u'l',u'i'>::type long_name;
+};
+
+template <>
+struct ratio_static_string<milli, char32_t>
+{
+ typedef static_string::u32str_1<U'm'>::type short_name;
+ typedef static_string::u32str_5<U'm',U'i',U'l',U'l',U'i'>::type long_name;
+};
+
+#endif
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_static_string<milli, wchar_t>
+{
+ typedef static_string::wstr_1<L'm'>::type short_name;
+ typedef static_string::wstr_5<L'm',L'i',L'l',L'l',L'i'>::type long_name;
+};
+#endif
+
+// centi
+
+template <>
+struct ratio_static_string<centi, char>
+{
+ typedef static_string::str_1<'c'>::type short_name;
+ typedef static_string::str_5<'c','e','n','t','i'>::type long_name;
+};
+
+#ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT
+
+template <>
+struct ratio_static_string<centi, char16_t>
+{
+ typedef static_string::u16str_1<u'c'>::type short_name;
+ typedef static_string::u16str_5<u'c',u'e',u'n',u't',u'i'>::type long_name;
+};
+
+template <>
+struct ratio_static_string<centi, char32_t>
+{
+ typedef static_string::u32str_1<U'c'>::type short_name;
+ typedef static_string::u32str_5<U'c',U'e',U'n',U't',U'i'>::type long_name;
+};
+
+#endif
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_static_string<centi, wchar_t>
+{
+ typedef static_string::wstr_1<L'c'>::type short_name;
+ typedef static_string::wstr_5<L'c',L'e',L'n',L't',L'i'>::type long_name;
+};
+#endif
+
+// deci
+
+template <>
+struct ratio_static_string<deci, char>
+{
+ typedef static_string::str_1<'d'>::type short_name;
+ typedef static_string::str_4<'d','e','c','i'>::type long_name;
+};
+
+#ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT
+
+template <>
+struct ratio_static_string<deci, char16_t>
+{
+ typedef static_string::u16str_1<u'd'>::type short_name;
+ typedef static_string::u16str_4<u'd',u'e',u'c',u'i'>::type long_name;
+};
+
+template <>
+struct ratio_static_string<deci, char32_t>
+{
+ typedef static_string::u32str_1<U'd'>::type short_name;
+ typedef static_string::u32str_4<U'd',U'e',U'c',U'i'>::type long_name;
+};
+
+#endif
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_static_string<deci, wchar_t>
+{
+ typedef static_string::wstr_1<L'd'>::type short_name;
+ typedef static_string::wstr_4<L'd',L'e',L'c',L'i'>::type long_name;
+};
+#endif
+
+// deca
+
+template <>
+struct ratio_static_string<deca, char>
+{
+ typedef static_string::str_2<'d','a'>::type short_name;
+ typedef static_string::str_4<'d','e','c','a'>::type long_name;
+};
+
+#ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT
+
+template <>
+struct ratio_static_string<deca, char16_t>
+{
+ typedef static_string::u16str_2<u'd',u'a'>::type short_name;
+ typedef static_string::u16str_4<u'd',u'e',u'c',u'a'>::type long_name;
+};
+
+template <>
+struct ratio_static_string<deca, char32_t>
+{
+ typedef static_string::u32str_2<U'd',U'a'>::type short_name;
+ typedef static_string::u32str_4<U'd',U'e',U'c',U'a'>::type long_name;
+};
+
+#endif
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_static_string<deca, wchar_t>
+{
+ typedef static_string::wstr_2<L'd',L'a'>::type short_name;
+ typedef static_string::wstr_4<L'd',L'e',L'c',L'a'>::type long_name;
+};
+#endif
+
+// hecto
+
+template <>
+struct ratio_static_string<hecto, char>
+{
+ typedef static_string::str_1<'h'>::type short_name;
+ typedef static_string::str_5<'h','e','c','t','o'>::type long_name;
+};
+
+#ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT
+
+template <>
+struct ratio_static_string<hecto, char16_t>
+{
+ typedef static_string::u16str_1<u'h'>::type short_name;
+ typedef static_string::u16str_5<u'h',u'e',u'c',u't',u'o'>::type long_name;
+};
+
+template <>
+struct ratio_static_string<hecto, char32_t>
+{
+ typedef static_string::u32str_1<U'h'>::type short_name;
+ typedef static_string::u32str_5<U'h',U'e',U'c',U't',U'o'>::type long_name;
+};
+
+#endif
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_static_string<hecto, wchar_t>
+{
+ typedef static_string::wstr_1<L'h'>::type short_name;
+ typedef static_string::wstr_5<L'h',L'e',L'c',L't',L'o'>::type long_name;
+};
+#endif
+
+// kilo
+
+template <>
+struct ratio_static_string<kilo, char>
+{
+ typedef static_string::str_1<'k'>::type short_name;
+ typedef static_string::str_4<'k','i','l','o'>::type long_name;
+};
+
+#ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT
+
+template <>
+struct ratio_static_string<kilo, char16_t>
+{
+ typedef static_string::u16str_1<u'k'>::type short_name;
+ typedef static_string::u16str_4<u'k',u'i',u'l',u'o'>::type long_name;
+};
+
+template <>
+struct ratio_static_string<kilo, char32_t>
+{
+ typedef static_string::u32str_1<U'k'>::type short_name;
+ typedef static_string::u32str_4<U'k',U'i',U'l',U'o'>::type long_name;
+};
+
+#endif
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_static_string<kilo, wchar_t>
+{
+ typedef static_string::wstr_1<L'k'>::type short_name;
+ typedef static_string::wstr_4<L'k',L'i',L'l',L'o'>::type long_name;
+};
+#endif
+
+// mega
+
+template <>
+struct ratio_static_string<mega, char>
+{
+ typedef static_string::str_1<'M'>::type short_name;
+ typedef static_string::str_4<'m','e','g','a'>::type long_name;
+};
+
+#ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT
+
+template <>
+struct ratio_static_string<mega, char16_t>
+{
+ typedef static_string::u16str_1<u'M'>::type short_name;
+ typedef static_string::u16str_4<u'm',u'e',u'g',u'a'>::type long_name;
+};
+
+template <>
+struct ratio_static_string<mega, char32_t>
+{
+ typedef static_string::u32str_1<U'M'>::type short_name;
+ typedef static_string::u32str_4<U'm',U'e',U'g',U'a'>::type long_name;
+};
+
+#endif
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_static_string<mega, wchar_t>
+{
+ typedef static_string::wstr_1<L'M'>::type short_name;
+ typedef static_string::wstr_4<L'm',L'e',L'g',L'a'>::type long_name;
+};
+#endif
+
+// giga
+
+template <>
+struct ratio_static_string<giga, char>
+{
+ typedef static_string::str_1<'G'>::type short_name;
+ typedef static_string::str_4<'g','i','g','a'>::type long_name;
+};
+
+#ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT
+
+template <>
+struct ratio_static_string<giga, char16_t>
+{
+ typedef static_string::u16str_1<u'G'>::type short_name;
+ typedef static_string::u16str_4<u'g',u'i',u'g',u'a'>::type long_name;
+};
+
+template <>
+struct ratio_static_string<giga, char32_t>
+{
+ typedef static_string::u32str_1<U'G'>::type short_name;
+ typedef static_string::u32str_4<U'g',U'i',U'g',U'a'>::type long_name;
+};
+
+#endif
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_static_string<giga, wchar_t>
+{
+ typedef static_string::wstr_1<L'G'>::type short_name;
+ typedef static_string::wstr_4<L'g',L'i',L'g',L'a'>::type long_name;
+};
+#endif
+
+// tera
+
+template <>
+struct ratio_static_string<tera, char>
+{
+ typedef static_string::str_1<'T'>::type short_name;
+ typedef static_string::str_4<'t','e','r','a'>::type long_name;
+};
+
+#ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT
+
+template <>
+struct ratio_static_string<tera, char16_t>
+{
+ typedef static_string::u16str_1<u'T'>::type short_name;
+ typedef static_string::u16str_4<u't',u'e',u'r',u'a'>::type long_name;
+};
+
+template <>
+struct ratio_static_string<tera, char32_t>
+{
+ typedef static_string::u32str_1<U'T'>::type short_name;
+ typedef static_string::u32str_4<U't',U'e',U'r',U'a'>::type long_name;
+};
+
+#endif
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_static_string<tera, wchar_t>
+{
+ typedef static_string::wstr_1<L'T'>::type short_name;
+ typedef static_string::wstr_4<L'r',L'e',L'r',L'a'>::type long_name;
+};
+#endif
+
+// peta
+
+template <>
+struct ratio_static_string<peta, char>
+{
+ typedef static_string::str_1<'P'>::type short_name;
+ typedef static_string::str_4<'p','e','t','a'>::type long_name;
+};
+
+#ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT
+
+template <>
+struct ratio_static_string<peta, char16_t>
+{
+ typedef static_string::u16str_1<u'P'>::type short_name;
+ typedef static_string::u16str_4<u'p',u'e',u't',u'a'>::type long_name;
+};
+
+template <>
+struct ratio_static_string<peta, char32_t>
+{
+ typedef static_string::u32str_1<U'P'>::type short_name;
+ typedef static_string::u32str_4<U'p',U'e',U't',U'a'>::type long_name;
+};
+
+#endif
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_static_string<peta, wchar_t>
+{
+ typedef static_string::wstr_1<L'P'>::type short_name;
+ typedef static_string::wstr_4<L'p',L'e',L't',L'a'>::type long_name;
+};
+#endif
+
+// exa
+
+template <>
+struct ratio_static_string<exa, char>
+{
+ typedef static_string::str_1<'E'>::type short_name;
+ typedef static_string::str_3<'e','x','a'>::type long_name;
+};
+
+#ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT
+
+template <>
+struct ratio_static_string<exa, char16_t>
+{
+ typedef static_string::u16str_1<u'E'>::type short_name;
+ typedef static_string::u16str_3<u'e',u'x',u'a'>::type long_name;
+};
+
+template <>
+struct ratio_static_string<exa, char32_t>
+{
+ typedef static_string::u32str_1<U'E'>::type short_name;
+ typedef static_string::u32str_3<U'e',U'x',U'a'>::type long_name;
+};
+
+#endif
+
+#ifndef BOOST_NO_STD_WSTRING
+template <>
+struct ratio_static_string<exa, wchar_t>
+{
+ typedef static_string::wstr_1<L'E'>::type short_name;
+ typedef static_string::wstr_3<L'e',L'x',L'a'>::type long_name;
+};
+#endif
+
+}
+
+#endif // BOOST_RATIO_RATIO_STATIC_STRING_HPP
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