Ratio: merge from trunk 1.53

[SVN r81665]
This commit is contained in:
Vicente J. Botet Escriba 2012-12-01 23:39:04 +00:00
parent 487c93c6ff
commit 39fb839297
34 changed files with 48 additions and 50 deletions

View File

@ -1205,10 +1205,6 @@ The primary template provides generic strings. Specializations provide the same
[section:spe Specializations for `ratio_string<>`] [section:spe Specializations for `ratio_string<>`]
With compilers supporting char16_t and char32_t and with a standard library don't providing std::u16string and std::u32string you will need to
define the macros BOOST_NO_CXX11_U16STRING and BOOST_NO_CXX11_U32STRING until Boost.Config defines them.
For each specialization the table gives the return value for `prefix()` and `symbol()`. For each specialization the table gives the return value for `prefix()` and `symbol()`.
[table The return values of specializations of ratio_string [table The return values of specializations of ratio_string
@ -1863,10 +1859,6 @@ The specialization relays on the __ratio_greater_equal template class.
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. 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.
[*Fixes:]
* [@http://svn.boost.org/trac/boost/ticket/7478 #7478] Compiles fails with compilers supporting char16_t and char32_t fails if the library doesn't provides std::u16string and std::u32string.
[endsect] [endsect]
[section [*Version 1.0.3, August 1, 2012 - 1.51] ] [section [*Version 1.0.3, August 1, 2012 - 1.51] ]

View File

@ -91,7 +91,7 @@
// define constexpr related macros ------------------------------// // define constexpr related macros ------------------------------//
//~ #include <boost/config.hpp> //~ #include <boost/config.hpp>
#if defined(BOOST_NO_CONSTEXPR) #if defined(BOOST_NO_CXX11_CONSTEXPR)
#define BOOST_EX_CHRONO_CONSTEXPR #define BOOST_EX_CHRONO_CONSTEXPR
#define BOOST_EX_CHRONO_CONST_REF const& #define BOOST_EX_CHRONO_CONST_REF const&
#else #else

View File

@ -55,7 +55,7 @@ time2_demo contained this comment:
#include <boost/detail/workaround.hpp> #include <boost/detail/workaround.hpp>
#include <boost/integer_traits.hpp> #include <boost/integer_traits.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) || !defined(BOOST_EX_CHRONO_USES_MPL_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT) || !defined(BOOST_EX_CHRONO_USES_MPL_ASSERT)
#define BOOST_EX_CHRONO_A_DURATION_REPRESENTATION_CAN_NOT_BE_A_DURATION "A duration representation can not be a duration" #define BOOST_EX_CHRONO_A_DURATION_REPRESENTATION_CAN_NOT_BE_A_DURATION "A duration representation can not be a duration"
#define BOOST_EX_CHRONO_SECOND_TEMPLATE_PARAMETER_OF_DURATION_MUST_BE_A_STD_RATIO "Second template parameter of duration must be a boost::ratio" #define BOOST_EX_CHRONO_SECOND_TEMPLATE_PARAMETER_OF_DURATION_MUST_BE_A_STD_RATIO "Second template parameter of duration must be a boost::ratio"
#define BOOST_EX_CHRONO_DURATION_PERIOD_MUST_BE_POSITIVE "duration period must be positive" #define BOOST_EX_CHRONO_DURATION_PERIOD_MUST_BE_POSITIVE "duration period must be positive"

View File

@ -11,7 +11,7 @@
#include "config.hpp" #include "config.hpp"
#ifndef BOOST_NO_STATIC_ASSERT #ifndef BOOST_NO_CXX11_STATIC_ASSERT
#define BOOST_EX_CHRONO_STATIC_ASSERT(CND, MSG, TYPES) static_assert(CND,MSG) #define BOOST_EX_CHRONO_STATIC_ASSERT(CND, MSG, TYPES) static_assert(CND,MSG)
#elif defined(BOOST_CHRONO_USES_STATIC_ASSERT) #elif defined(BOOST_CHRONO_USES_STATIC_ASSERT)
#include <boost/static_assert.hpp> #include <boost/static_assert.hpp>

View File

@ -42,7 +42,7 @@ namespace type_traits_detail {
template <typename T> template <typename T>
struct add_rvalue_reference_helper<T, true> struct add_rvalue_reference_helper<T, true>
{ {
#if !defined(BOOST_NO_RVALUE_REFERENCES) #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
typedef T&& type; typedef T&& type;
#else #else
typedef T type; typedef T type;

View File

@ -12,18 +12,18 @@
#include <boost/config.hpp> #include <boost/config.hpp>
//----------------------------------------------------------------------------// //----------------------------------------------------------------------------//
#if defined(BOOST_NO_VARIADIC_TEMPLATES) #if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
#define BOOST_EX_COMMON_TYPE_ARITY 3 #define BOOST_EX_COMMON_TYPE_ARITY 3
#endif #endif
//----------------------------------------------------------------------------// //----------------------------------------------------------------------------//
#if defined(BOOST_NO_DECLTYPE) && !defined(BOOST_EX_COMMON_TYPE_DONT_USE_TYPEOF) #if defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_EX_COMMON_TYPE_DONT_USE_TYPEOF)
#define BOOST_TYPEOF_SILENT #define BOOST_TYPEOF_SILENT
#include <boost/typeof/typeof.hpp> // boost wonders never cease! #include <boost/typeof/typeof.hpp> // boost wonders never cease!
#endif #endif
//----------------------------------------------------------------------------// //----------------------------------------------------------------------------//
#ifndef BOOST_NO_STATIC_ASSERT #ifndef BOOST_NO_CXX11_STATIC_ASSERT
#define BOOST_EX_COMMON_TYPE_STATIC_ASSERT(CND, MSG, TYPES) static_assert(CND,MSG) #define BOOST_EX_COMMON_TYPE_STATIC_ASSERT(CND, MSG, TYPES) static_assert(CND,MSG)
#elif defined(BOOST_EX_COMMON_TYPE_USES_STATIC_ASSERT) #elif defined(BOOST_EX_COMMON_TYPE_USES_STATIC_ASSERT)
#include <boost/static_assert.hpp> #include <boost/static_assert.hpp>
@ -41,11 +41,11 @@
//~ #define BOOST_EX_COMMON_TYPE_STATIC_ASSERT(CND, MSG, TYPES) //~ #define BOOST_EX_COMMON_TYPE_STATIC_ASSERT(CND, MSG, TYPES)
#endif #endif
#if !defined(BOOST_NO_STATIC_ASSERT) || !defined(BOOST_EX_COMMON_TYPE_USES_MPL_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT) || !defined(BOOST_EX_COMMON_TYPE_USES_MPL_ASSERT)
#define BOOST_EX_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE "must be complete type" #define BOOST_EX_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE "must be complete type"
#endif #endif
#if defined(BOOST_NO_DECLTYPE) && defined(BOOST_EX_COMMON_TYPE_DONT_USE_TYPEOF) #if defined(BOOST_NO_CXX11_DECLTYPE) && defined(BOOST_EX_COMMON_TYPE_DONT_USE_TYPEOF)
#include "detail/common_type.hpp" #include "detail/common_type.hpp"
#include <boost/type_traits/remove_cv.hpp> #include <boost/type_traits/remove_cv.hpp>
#endif #endif
@ -64,7 +64,7 @@
namespace boost_ex { namespace boost_ex {
// prototype // prototype
#if !defined(BOOST_NO_VARIADIC_TEMPLATES) #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template<typename... T> template<typename... T>
struct common_type; struct common_type;
#else // or no specialization #else // or no specialization
@ -79,7 +79,7 @@ namespace boost_ex {
// 1 arg // 1 arg
template<typename T> template<typename T>
#if !defined(BOOST_NO_VARIADIC_TEMPLATES) #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
struct common_type<T> struct common_type<T>
#else #else
struct common_type<T, void, void> struct common_type<T, void, void>
@ -104,7 +104,7 @@ namespace type_traits_detail {
static typename add_rvalue_reference<T>::type declval_T(); // workaround gcc bug; not required by std static typename add_rvalue_reference<T>::type declval_T(); // workaround gcc bug; not required by std
static typename add_rvalue_reference<U>::type declval_U(); // workaround gcc bug; not required by std static typename add_rvalue_reference<U>::type declval_U(); // workaround gcc bug; not required by std
#if !defined(BOOST_NO_DECLTYPE) #if !defined(BOOST_NO_CXX11_DECLTYPE)
public: public:
typedef decltype(declval<bool>() ? declval<T>() : declval<U>()) type; typedef decltype(declval<bool>() ? declval<T>() : declval<U>()) type;
#elif defined(BOOST_EX_COMMON_TYPE_DONT_USE_TYPEOF) #elif defined(BOOST_EX_COMMON_TYPE_DONT_USE_TYPEOF)
@ -127,7 +127,7 @@ namespace type_traits_detail {
}; };
} }
#if !defined(BOOST_NO_VARIADIC_TEMPLATES) #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template <class T, class U> template <class T, class U>
struct common_type<T, U> struct common_type<T, U>
#else #else
@ -139,7 +139,7 @@ namespace type_traits_detail {
// 3 or more args // 3 or more args
#if !defined(BOOST_NO_VARIADIC_TEMPLATES) #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template<typename T, typename U, typename... V> template<typename T, typename U, typename... V>
struct common_type<T, U, V...> { struct common_type<T, U, V...> {
public: public:

View File

@ -49,6 +49,12 @@
#define BOOST_RATIO_INTMAX_C(a) a##LL #define BOOST_RATIO_INTMAX_C(a) a##LL
#endif #endif
#ifdef UINTMAX_C
#define BOOST_RATIO_UINTMAX_C(a) UINTMAX_C(a)
#else
#define BOOST_RATIO_UINTMAX_C(a) a##ULL
#endif
#define BOOST_RATIO_INTMAX_T_MAX (0x7FFFFFFFFFFFFFFELL) #define BOOST_RATIO_INTMAX_T_MAX (0x7FFFFFFFFFFFFFFELL)

View File

@ -133,7 +133,7 @@ namespace ratio_detail
class br_mul class br_mul
{ {
static const boost::intmax_t nan = static const boost::intmax_t nan =
(BOOST_RATIO_INTMAX_C(1) << (sizeof(boost::intmax_t) * CHAR_BIT - 1)); boost::intmax_t(BOOST_RATIO_UINTMAX_C(1) << (sizeof(boost::intmax_t) * CHAR_BIT - 1));
static const boost::intmax_t min = boost::integer_traits<boost::intmax_t>::const_min; static const boost::intmax_t min = boost::integer_traits<boost::intmax_t>::const_min;
static const boost::intmax_t max = boost::integer_traits<boost::intmax_t>::const_max; static const boost::intmax_t max = boost::integer_traits<boost::intmax_t>::const_max;
@ -172,7 +172,7 @@ namespace ratio_detail
template <boost::intmax_t X, boost::intmax_t Y> template <boost::intmax_t X, boost::intmax_t Y>
class br_div class br_div
{ {
static const boost::intmax_t nan = (1LL << (sizeof(boost::intmax_t) * CHAR_BIT - 1)); static const boost::intmax_t nan = boost::intmax_t(BOOST_RATIO_UINTMAX_C(1) << (sizeof(boost::intmax_t) * CHAR_BIT - 1));
static const boost::intmax_t min = boost::integer_traits<boost::intmax_t>::const_min; static const boost::intmax_t min = boost::integer_traits<boost::intmax_t>::const_min;
static const boost::intmax_t max = boost::integer_traits<boost::intmax_t>::const_max; static const boost::intmax_t max = boost::integer_traits<boost::intmax_t>::const_max;

View File

@ -14,7 +14,7 @@
#include <boost/ratio/ratio.hpp> #include <boost/ratio/ratio.hpp>
#include <boost/integer_traits.hpp> #include <boost/integer_traits.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif

View File

@ -14,7 +14,7 @@
// test ratio_add // test ratio_add
#include <boost/ratio/ratio.hpp> #include <boost/ratio/ratio.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif

View File

@ -14,7 +14,7 @@
// test ratio_divide // test ratio_divide
#include <boost/ratio/ratio.hpp> #include <boost/ratio/ratio.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif

View File

@ -14,7 +14,7 @@
// test ratio_multiply // test ratio_multiply
#include <boost/ratio/ratio.hpp> #include <boost/ratio/ratio.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif

View File

@ -14,7 +14,7 @@
// test ratio_subtract // test ratio_subtract
#include <boost/ratio/ratio.hpp> #include <boost/ratio/ratio.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif

View File

@ -14,7 +14,7 @@
// test ratio_equal // test ratio_equal
#include <boost/ratio/ratio.hpp> #include <boost/ratio/ratio.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif

View File

@ -12,7 +12,7 @@
// See http://www.boost.org/LICENSE_1_0.txt // See http://www.boost.org/LICENSE_1_0.txt
#include <boost/ratio/ratio.hpp> #include <boost/ratio/ratio.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif

View File

@ -12,7 +12,7 @@
// See http://www.boost.org/LICENSE_1_0.txt // See http://www.boost.org/LICENSE_1_0.txt
#include <boost/ratio/ratio.hpp> #include <boost/ratio/ratio.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif

View File

@ -12,7 +12,7 @@
// See http://www.boost.org/LICENSE_1_0.txt // See http://www.boost.org/LICENSE_1_0.txt
#include <boost/ratio/ratio.hpp> #include <boost/ratio/ratio.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif

View File

@ -12,7 +12,7 @@
// See http://www.boost.org/LICENSE_1_0.txt // See http://www.boost.org/LICENSE_1_0.txt
#include <boost/ratio/ratio.hpp> #include <boost/ratio/ratio.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif

View File

@ -12,7 +12,7 @@
// See http://www.boost.org/LICENSE_1_0.txt // See http://www.boost.org/LICENSE_1_0.txt
#include <boost/ratio/ratio.hpp> #include <boost/ratio/ratio.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif

View File

@ -16,7 +16,7 @@
#define BOOST_RATIO_EXTENSIONS #define BOOST_RATIO_EXTENSIONS
#include <boost/ratio/mpl/abs.hpp> #include <boost/ratio/mpl/abs.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif

View File

@ -16,7 +16,7 @@
#define BOOST_RATIO_EXTENSIONS #define BOOST_RATIO_EXTENSIONS
#include <boost/ratio/mpl/divides.hpp> #include <boost/ratio/mpl/divides.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif

View File

@ -16,7 +16,7 @@
#define BOOST_RATIO_EXTENSIONS #define BOOST_RATIO_EXTENSIONS
#include <boost/ratio/mpl/equal_to.hpp> #include <boost/ratio/mpl/equal_to.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif

View File

@ -14,7 +14,7 @@
#define BOOST_RATIO_EXTENSIONS #define BOOST_RATIO_EXTENSIONS
#include <boost/ratio/mpl/greater_equal.hpp> #include <boost/ratio/mpl/greater_equal.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif

View File

@ -14,7 +14,7 @@
#define BOOST_RATIO_EXTENSIONS #define BOOST_RATIO_EXTENSIONS
#include <boost/ratio/mpl/greater.hpp> #include <boost/ratio/mpl/greater.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif

View File

@ -14,7 +14,7 @@
#define BOOST_RATIO_EXTENSIONS #define BOOST_RATIO_EXTENSIONS
#include <boost/ratio/mpl/less_equal.hpp> #include <boost/ratio/mpl/less_equal.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif

View File

@ -14,7 +14,7 @@
#define BOOST_RATIO_EXTENSIONS #define BOOST_RATIO_EXTENSIONS
#include <boost/ratio/mpl/less.hpp> #include <boost/ratio/mpl/less.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif

View File

@ -16,7 +16,7 @@
#define BOOST_RATIO_EXTENSIONS #define BOOST_RATIO_EXTENSIONS
#include <boost/ratio/mpl/minus.hpp> #include <boost/ratio/mpl/minus.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif

View File

@ -16,7 +16,7 @@
#define BOOST_RATIO_EXTENSIONS #define BOOST_RATIO_EXTENSIONS
#include <boost/ratio/mpl/negate.hpp> #include <boost/ratio/mpl/negate.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif

View File

@ -14,7 +14,7 @@
#define BOOST_RATIO_EXTENSIONS #define BOOST_RATIO_EXTENSIONS
#include <boost/ratio/mpl/not_equal_to.hpp> #include <boost/ratio/mpl/not_equal_to.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif

View File

@ -16,7 +16,7 @@
#define BOOST_RATIO_EXTENSIONS #define BOOST_RATIO_EXTENSIONS
#include <boost/ratio/mpl/plus.hpp> #include <boost/ratio/mpl/plus.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif

View File

@ -16,7 +16,7 @@
#define BOOST_RATIO_EXTENSIONS #define BOOST_RATIO_EXTENSIONS
#include <boost/ratio/mpl/sign.hpp> #include <boost/ratio/mpl/sign.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif

View File

@ -16,7 +16,7 @@
#define BOOST_RATIO_EXTENSIONS #define BOOST_RATIO_EXTENSIONS
#include <boost/ratio/mpl/times.hpp> #include <boost/ratio/mpl/times.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif

View File

@ -16,7 +16,7 @@
#include <boost/ratio/ratio.hpp> #include <boost/ratio/ratio.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif

View File

@ -6,7 +6,7 @@
#include <boost/ratio/ratio.hpp> #include <boost/ratio/ratio.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT) #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
#define NOTHING "" #define NOTHING ""
#endif #endif