// 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 #include namespace lslboost { template struct ratio_string { static basic_string short_name(); static basic_string long_name(); }; } // boost */ #include #include #include #include #include #if defined(BOOST_NO_CXX11_UNICODE_LITERALS) || defined(BOOST_NO_CXX11_CHAR16_T) || defined(BOOST_NO_CXX11_CHAR32_T) || defined(BOOST_NO_CXX11_U16STRING) || defined(BOOST_NO_CXX11_U32STRING) #if defined BOOST_RATIO_HAS_UNICODE_SUPPORT #undef BOOST_RATIO_HAS_UNICODE_SUPPORT #endif #else #define BOOST_RATIO_HAS_UNICODE_SUPPORT 1 #endif namespace lslboost { //template //struct ratio_string_is_localizable : false_type {}; //template //struct ratio_string_id : integral_constant {}; template struct ratio_string { static std::basic_string short_name() {return long_name();} static std::basic_string long_name(); static std::basic_string symbol() {return short_name();} static std::basic_string prefix() {return long_name();} }; template std::basic_string ratio_string::long_name() { std::basic_ostringstream os; os << CharT('[') << Ratio::num << CharT('/') << Ratio::den << CharT(']'); return os.str(); } #ifdef BOOST_RATIO_HAS_STATIC_STRING namespace ratio_detail { template struct ratio_string_static { static std::string short_name() { return std::basic_string( static_string::c_str< typename ratio_static_string::short_name >::value); } static std::string long_name() { return std::basic_string( static_string::c_str< typename ratio_static_string::long_name >::value); } static std::basic_string symbol() {return short_name();} static std::basic_string prefix() {return long_name();} }; } #endif // atto //template <> //struct ratio_string_is_localizable : true_type {}; // //template <> //struct ratio_string_id : integral_constant {}; #ifdef BOOST_RATIO_HAS_STATIC_STRING template struct ratio_string : ratio_detail::ratio_string_static {}; #else template <> struct ratio_string { 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 { 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 { 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 { 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 : true_type {}; // //template <> //struct ratio_string_id : integral_constant {}; #ifdef BOOST_RATIO_HAS_STATIC_STRING template struct ratio_string : ratio_detail::ratio_string_static {}; #else template <> struct ratio_string { 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 { 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 { 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 { 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 : true_type {}; // //template <> //struct ratio_string_id : integral_constant {}; #ifdef BOOST_RATIO_HAS_STATIC_STRING template struct ratio_string : ratio_detail::ratio_string_static {}; #else template <> struct ratio_string { 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 { 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 { 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 { 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 : true_type {}; // //template <> //struct ratio_string_id : integral_constant {}; #ifdef BOOST_RATIO_HAS_STATIC_STRING template struct ratio_string : ratio_detail::ratio_string_static {}; #else template <> struct ratio_string { 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 { 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 { 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 { 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 : true_type {}; // //template <> //struct ratio_string_id : integral_constant {}; #ifdef BOOST_RATIO_HAS_STATIC_STRING template struct ratio_string : ratio_detail::ratio_string_static {}; #else template <> struct ratio_string { 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 { 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 { 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 { 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 : true_type {}; // //template <> //struct ratio_string_id : integral_constant {}; #ifdef BOOST_RATIO_HAS_STATIC_STRING template struct ratio_string : ratio_detail::ratio_string_static {}; #else template <> struct ratio_string { 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 { 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 { 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 { 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 : true_type {}; // //template <> //struct ratio_string_id : integral_constant {}; #ifdef BOOST_RATIO_HAS_STATIC_STRING template struct ratio_string : ratio_detail::ratio_string_static {}; #else template <> struct ratio_string { 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 { 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 { 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 { 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 : true_type {}; // //template <> //struct ratio_string_id : integral_constant {}; #ifdef BOOST_RATIO_HAS_STATIC_STRING template struct ratio_string : ratio_detail::ratio_string_static {}; #else template <> struct ratio_string { 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 { 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 { 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 { 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 > : true_type {}; // //template <> //struct ratio_string_id > : integral_constant {}; // deca //template <> //struct ratio_string_is_localizable : true_type {}; // //template <> //struct ratio_string_id : integral_constant {}; #ifdef BOOST_RATIO_HAS_STATIC_STRING template struct ratio_string : ratio_detail::ratio_string_static {}; #else template <> struct ratio_string { 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 { 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 { 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 { 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 : true_type {}; // //template <> //struct ratio_string_id : integral_constant {}; #ifdef BOOST_RATIO_HAS_STATIC_STRING template struct ratio_string : ratio_detail::ratio_string_static {}; #else template <> struct ratio_string { 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 { 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 { 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 { 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 : true_type {}; // //template <> //struct ratio_string_id : integral_constant {}; #ifdef BOOST_RATIO_HAS_STATIC_STRING template struct ratio_string : ratio_detail::ratio_string_static {}; #else template <> struct ratio_string { 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 { 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 { 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 { 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 : true_type {}; // //template <> //struct ratio_string_id : integral_constant {}; #ifdef BOOST_RATIO_HAS_STATIC_STRING template struct ratio_string : ratio_detail::ratio_string_static {}; #else template <> struct ratio_string { 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 { 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 { 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 { 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 : true_type {}; // //template <> //struct ratio_string_id : integral_constant {}; #ifdef BOOST_RATIO_HAS_STATIC_STRING template struct ratio_string : ratio_detail::ratio_string_static {}; #else template <> struct ratio_string { 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 { 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 { 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 { 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 : true_type {}; // //template <> //struct ratio_string_id : integral_constant {}; #ifdef BOOST_RATIO_HAS_STATIC_STRING template struct ratio_string : ratio_detail::ratio_string_static {}; #else template <> struct ratio_string { 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 { 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 { 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 { 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 : true_type {}; // //template <> //struct ratio_string_id : integral_constant {}; #ifdef BOOST_RATIO_HAS_STATIC_STRING template struct ratio_string : ratio_detail::ratio_string_static {}; #else template <> struct ratio_string { 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 { 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 { 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 { 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 : true_type {}; // //template <> //struct ratio_string_id : integral_constant {}; #ifdef BOOST_RATIO_HAS_STATIC_STRING template struct ratio_string : ratio_detail::ratio_string_static {}; #else template <> struct ratio_string { 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 { 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 { 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 { 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 #ifdef BOOST_RATIO_EXTENSIONS #ifdef BOOST_RATIO_HAS_STATIC_STRING template struct ratio_string : ratio_detail::ratio_string_static {}; #else template <> struct ratio_string { static std::string short_name() {return std::string("Ki");} static std::string long_name() {return std::string("kibi");} static std::string symbol() {return short_name();} static std::string prefix() {return long_name();} }; #if BOOST_RATIO_HAS_UNICODE_SUPPORT template <> struct ratio_string { static std::u16string short_name() {return std::u16string(u"Ki");} static std::u16string long_name() {return std::u16string(u"kibi");} static std::u16string symbol() {return short_name();} static std::u16string prefix() {return long_name();} }; template <> struct ratio_string { static std::u32string short_name() {return std::u32string(U"Ki");} static std::u32string long_name() {return std::u32string(U"kibi");} static std::u32string symbol() {return short_name();} static std::u32string prefix() {return long_name();} }; #endif #ifndef BOOST_NO_STD_WSTRING template <> struct ratio_string { static std::wstring short_name() {return std::wstring(L"Ki");} static std::wstring long_name() {return std::wstring(L"kibi");} static std::wstring symbol() {return short_name();} static std::wstring prefix() {return long_name();} }; #endif #endif #ifdef BOOST_RATIO_HAS_STATIC_STRING template struct ratio_string : ratio_detail::ratio_string_static {}; #else template <> struct ratio_string { static std::string short_name() {return std::string("Mi");} static std::string long_name() {return std::string("mebi");} static std::string symbol() {return short_name();} static std::string prefix() {return long_name();} }; #if BOOST_RATIO_HAS_UNICODE_SUPPORT template <> struct ratio_string { static std::u16string short_name() {return std::u16string(u"Mi");} static std::u16string long_name() {return std::u16string(u"mebi");} static std::u16string symbol() {return short_name();} static std::u16string prefix() {return long_name();} }; template <> struct ratio_string { static std::u32string short_name() {return std::u32string(U"Mi");} static std::u32string long_name() {return std::u32string(U"mebi");} static std::u32string symbol() {return short_name();} static std::u32string prefix() {return long_name();} }; #endif #ifndef BOOST_NO_STD_WSTRING template <> struct ratio_string { static std::wstring short_name() {return std::wstring(L"Mi");} static std::wstring long_name() {return std::wstring(L"mebi");} static std::wstring symbol() {return short_name();} static std::wstring prefix() {return long_name();} }; #endif #endif #ifdef BOOST_RATIO_HAS_STATIC_STRING template struct ratio_string : ratio_detail::ratio_string_static {}; #else template <> struct ratio_string { static std::string short_name() {return std::string("Gi");} static std::string long_name() {return std::string("gibi");} static std::string symbol() {return short_name();} static std::string prefix() {return long_name();} }; #if BOOST_RATIO_HAS_UNICODE_SUPPORT template <> struct ratio_string { static std::u16string short_name() {return std::u16string(u"Gi");} static std::u16string long_name() {return std::u16string(u"gibi");} static std::u16string symbol() {return short_name();} static std::u16string prefix() {return long_name();} }; template <> struct ratio_string { static std::u32string short_name() {return std::u32string(U"Gi");} static std::u32string long_name() {return std::u32string(U"gibi");} static std::u32string symbol() {return short_name();} static std::u32string prefix() {return long_name();} }; #endif #ifndef BOOST_NO_STD_WSTRING template <> struct ratio_string { static std::wstring short_name() {return std::wstring(L"Gi");} static std::wstring long_name() {return std::wstring(L"gibi");} static std::wstring symbol() {return short_name();} static std::wstring prefix() {return long_name();} }; #endif #endif #ifdef BOOST_RATIO_HAS_STATIC_STRING template struct ratio_string : ratio_detail::ratio_string_static {}; #else template <> struct ratio_string { static std::string short_name() {return std::string("Ti");} static std::string long_name() {return std::string("tebi");} static std::string symbol() {return short_name();} static std::string prefix() {return long_name();} }; #if BOOST_RATIO_HAS_UNICODE_SUPPORT template <> struct ratio_string { static std::u16string short_name() {return std::u16string(u"Ti");} static std::u16string long_name() {return std::u16string(u"tebi");} static std::u16string symbol() {return short_name();} static std::u16string prefix() {return long_name();} }; template <> struct ratio_string { static std::u32string short_name() {return std::u32string(U"Ti");} static std::u32string long_name() {return std::u32string(U"tebi");} static std::u32string symbol() {return short_name();} static std::u32string prefix() {return long_name();} }; #endif #ifndef BOOST_NO_STD_WSTRING template <> struct ratio_string { static std::wstring short_name() {return std::wstring(L"Ti");} static std::wstring long_name() {return std::wstring(L"tebi");} static std::wstring symbol() {return short_name();} static std::wstring prefix() {return long_name();} }; #endif #endif #ifdef BOOST_RATIO_HAS_STATIC_STRING template struct ratio_string : ratio_detail::ratio_string_static {}; #else template <> struct ratio_string { static std::string short_name() {return std::string("Pi");} static std::string long_name() {return std::string("pebi");} static std::string symbol() {return short_name();} static std::string prefix() {return long_name();} }; #if BOOST_RATIO_HAS_UNICODE_SUPPORT template <> struct ratio_string { static std::u16string short_name() {return std::u16string(u"Pi");} static std::u16string long_name() {return std::u16string(u"pebi");} static std::u16string symbol() {return short_name();} static std::u16string prefix() {return long_name();} }; template <> struct ratio_string { static std::u32string short_name() {return std::u32string(U"Pi");} static std::u32string long_name() {return std::u32string(U"pebi");} static std::u32string symbol() {return short_name();} static std::u32string prefix() {return long_name();} }; #endif #ifndef BOOST_NO_STD_WSTRING template <> struct ratio_string { static std::wstring short_name() {return std::wstring(L"Pi");} static std::wstring long_name() {return std::wstring(L"pebi");} static std::wstring symbol() {return short_name();} static std::wstring prefix() {return long_name();} }; #endif #endif #ifdef BOOST_RATIO_HAS_STATIC_STRING template struct ratio_string : ratio_detail::ratio_string_static {}; #else template <> struct ratio_string { static std::string short_name() {return std::string("Ei");} static std::string long_name() {return std::string("exbi");} static std::string symbol() {return short_name();} static std::string prefix() {return long_name();} }; #if BOOST_RATIO_HAS_UNICODE_SUPPORT template <> struct ratio_string { static std::u16string short_name() {return std::u16string(u"Ei");} static std::u16string long_name() {return std::u16string(u"exbi");} static std::u16string symbol() {return short_name();} static std::u16string prefix() {return long_name();} }; template <> struct ratio_string { static std::u32string short_name() {return std::u32string(U"Ei");} static std::u32string long_name() {return std::u32string(U"exbi");} static std::u32string symbol() {return short_name();} static std::u32string prefix() {return long_name();} }; #endif #ifndef BOOST_NO_STD_WSTRING template <> struct ratio_string { static std::wstring short_name() {return std::wstring(L"Ei");} static std::wstring long_name() {return std::wstring(L"exbi");} static std::wstring symbol() {return short_name();} static std::wstring prefix() {return long_name();} }; #endif #endif #endif } #endif // BOOST_RATIO_RATIO_IO_HPP