|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r75666 - in branches/release/boost: chrono chrono/detail chrono/detail/inlined chrono/detail/inlined/mac chrono/detail/inlined/posix chrono/detail/inlined/win ratio/detail
From: vicente.botet_at_[hidden]
Date: 2011-11-25 19:49:15
Author: viboes
Date: 2011-11-25 19:49:13 EST (Fri, 25 Nov 2011)
New Revision: 75666
URL: http://svn.boost.org/trac/boost/changeset/75666
Log:
Chrono/Ratio merge trunk version v1
Text files modified:
branches/release/boost/chrono/config.hpp | 23 +++----------
branches/release/boost/chrono/detail/inlined/mac/chrono.hpp | 8 ++--
branches/release/boost/chrono/detail/inlined/mac/process_cpu_clocks.hpp | 8 ++--
branches/release/boost/chrono/detail/inlined/posix/chrono.hpp | 8 ++--
branches/release/boost/chrono/detail/inlined/posix/process_cpu_clocks.hpp | 8 ++--
branches/release/boost/chrono/detail/inlined/posix/thread_clock.hpp | 2
branches/release/boost/chrono/detail/inlined/process_cpu_clocks.hpp | 38 -----------------------
branches/release/boost/chrono/detail/inlined/win/chrono.hpp | 10 +++---
branches/release/boost/chrono/detail/inlined/win/process_cpu_clocks.hpp | 8 ++--
branches/release/boost/chrono/detail/inlined/win/thread_clock.hpp | 2
branches/release/boost/chrono/detail/is_evenly_divisible_by.hpp | 10 +++--
branches/release/boost/chrono/duration.hpp | 66 ++++++++++++++++++++--------------------
branches/release/boost/chrono/process_cpu_clocks.hpp | 30 +++++++++---------
branches/release/boost/chrono/system_clocks.hpp | 14 ++++----
branches/release/boost/chrono/thread_clock.hpp | 8 +++-
branches/release/boost/chrono/time_point.hpp | 60 ++++++++++++++++++------------------
branches/release/boost/ratio/detail/overflow_helpers.hpp | 38 ++++++++++++++++++----
17 files changed, 158 insertions(+), 183 deletions(-)
Modified: branches/release/boost/chrono/config.hpp
==============================================================================
--- branches/release/boost/chrono/config.hpp (original)
+++ branches/release/boost/chrono/config.hpp 2011-11-25 19:49:13 EST (Fri, 25 Nov 2011)
@@ -97,30 +97,17 @@
#define BOOST_CHRONO_HAS_UNICODE_SUPPORT 1
#endif
-// define constexpr related macros ------------------------------//
-
-#if defined(BOOST_NO_CONSTEXPR)
-#define BOOST_CHRONO_CONSTEXPR
-#define BOOST_CHRONO_CONSTEXPR_OR_CONST const
-#define BOOST_CHRONO_CONST_REF const&
-#else
-#define BOOST_CHRONO_CONSTEXPR constexpr
-#define BOOST_CHRONO_CONSTEXPR_OR_CONST constexpr
-#define BOOST_CHRONO_CONST_REF
-#endif
-
+#if ! defined BOOST_NOEXCEPT
#if defined(BOOST_NO_NOEXCEPT)
-#define BOOST_CHRONO_NOEXCEPT
+#define BOOST_NOEXCEPT
#else
-#define BOOST_CHRONO_NOEXCEPT noexcept
+#define BOOST_NOEXCEPT noexcept
+#endif
#endif
-
-#define BOOST_CHRONO_STATIC_CONSTEXPR static BOOST_CHRONO_CONSTEXPR_OR_CONST
-
#ifdef BOOST_CHRONO_HEADER_ONLY
#define BOOST_CHRONO_INLINE inline
-#define BOOST_CHRONO_STATIC
+#define BOOST_CHRONO_STATIC inline
#define BOOST_CHRONO_DECL
#else
Modified: branches/release/boost/chrono/detail/inlined/mac/chrono.hpp
==============================================================================
--- branches/release/boost/chrono/detail/inlined/mac/chrono.hpp (original)
+++ branches/release/boost/chrono/detail/inlined/mac/chrono.hpp 2011-11-25 19:49:13 EST (Fri, 25 Nov 2011)
@@ -26,7 +26,7 @@
// which has a field for seconds and a field for microseconds.
// Fill in the timeval and then convert that to the time_point
system_clock::time_point
-system_clock::now() BOOST_CHRONO_NOEXCEPT
+system_clock::now() BOOST_NOEXCEPT
{
timeval tv;
gettimeofday(&tv, 0);
@@ -50,14 +50,14 @@
// an integral count of seconds since New Years 1970 (same epoch as timeval).
// Just get the duration out of the time_point and truncate it to seconds.
time_t
-system_clock::to_time_t(const time_point& t) BOOST_CHRONO_NOEXCEPT
+system_clock::to_time_t(const time_point& t) BOOST_NOEXCEPT
{
return time_t(duration_cast<seconds>(t.time_since_epoch()).count());
}
// Just turn the time_t into a count of seconds and construct a time_point with it.
system_clock::time_point
-system_clock::from_time_t(time_t t) BOOST_CHRONO_NOEXCEPT
+system_clock::from_time_t(time_t t) BOOST_NOEXCEPT
{
return system_clock::time_point(seconds(t));
}
@@ -197,7 +197,7 @@
}
steady_clock::time_point
-steady_clock::now() BOOST_CHRONO_NOEXCEPT
+steady_clock::now() BOOST_NOEXCEPT
{
static kern_return_t err;
static chrono_detail::FP fp = chrono_detail::init_steady_clock(err);
Modified: branches/release/boost/chrono/detail/inlined/mac/process_cpu_clocks.hpp
==============================================================================
--- branches/release/boost/chrono/detail/inlined/mac/process_cpu_clocks.hpp (original)
+++ branches/release/boost/chrono/detail/inlined/mac/process_cpu_clocks.hpp 2011-11-25 19:49:13 EST (Fri, 25 Nov 2011)
@@ -46,7 +46,7 @@
}
- process_real_cpu_clock::time_point process_real_cpu_clock::now() BOOST_CHRONO_NOEXCEPT
+ process_real_cpu_clock::time_point process_real_cpu_clock::now() BOOST_NOEXCEPT
{
#if 0
tms tm;
@@ -179,7 +179,7 @@
}
#endif
- process_user_cpu_clock::time_point process_user_cpu_clock::now() BOOST_CHRONO_NOEXCEPT
+ process_user_cpu_clock::time_point process_user_cpu_clock::now() BOOST_NOEXCEPT
{
tms tm;
clock_t c = ::times(&tm);
@@ -200,7 +200,7 @@
}
return time_point();
}
- process_system_cpu_clock::time_point process_system_cpu_clock::now() BOOST_CHRONO_NOEXCEPT
+ process_system_cpu_clock::time_point process_system_cpu_clock::now() BOOST_NOEXCEPT
{
tms tm;
clock_t c = ::times(&tm);
@@ -262,7 +262,7 @@
}
#endif
- process_cpu_clock::time_point process_cpu_clock::now() BOOST_CHRONO_NOEXCEPT
+ process_cpu_clock::time_point process_cpu_clock::now() BOOST_NOEXCEPT
{
tms tm;
clock_t c = ::times(&tm);
Modified: branches/release/boost/chrono/detail/inlined/posix/chrono.hpp
==============================================================================
--- branches/release/boost/chrono/detail/inlined/posix/chrono.hpp (original)
+++ branches/release/boost/chrono/detail/inlined/posix/chrono.hpp 2011-11-25 19:49:13 EST (Fri, 25 Nov 2011)
@@ -17,7 +17,7 @@
namespace chrono
{
- system_clock::time_point system_clock::now() BOOST_CHRONO_NOEXCEPT
+ system_clock::time_point system_clock::now() BOOST_NOEXCEPT
{
timespec ts;
if ( ::clock_gettime( CLOCK_REALTIME, &ts ) )
@@ -59,19 +59,19 @@
}
#endif
- std::time_t system_clock::to_time_t(const system_clock::time_point& t) BOOST_CHRONO_NOEXCEPT
+ std::time_t system_clock::to_time_t(const system_clock::time_point& t) BOOST_NOEXCEPT
{
return static_cast<std::time_t>( t.time_since_epoch().count() / 1000000000 );
}
- system_clock::time_point system_clock::from_time_t(std::time_t t) BOOST_CHRONO_NOEXCEPT
+ system_clock::time_point system_clock::from_time_t(std::time_t t) BOOST_NOEXCEPT
{
return time_point(duration(static_cast<system_clock::rep>(t) * 1000000000));
}
#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
- steady_clock::time_point steady_clock::now() BOOST_CHRONO_NOEXCEPT
+ steady_clock::time_point steady_clock::now() BOOST_NOEXCEPT
{
timespec ts;
if ( ::clock_gettime( CLOCK_MONOTONIC, &ts ) )
Modified: branches/release/boost/chrono/detail/inlined/posix/process_cpu_clocks.hpp
==============================================================================
--- branches/release/boost/chrono/detail/inlined/posix/process_cpu_clocks.hpp (original)
+++ branches/release/boost/chrono/detail/inlined/posix/process_cpu_clocks.hpp 2011-11-25 19:49:13 EST (Fri, 25 Nov 2011)
@@ -41,7 +41,7 @@
}
}
-process_real_cpu_clock::time_point process_real_cpu_clock::now() BOOST_CHRONO_NOEXCEPT
+process_real_cpu_clock::time_point process_real_cpu_clock::now() BOOST_NOEXCEPT
{
tms tm;
clock_t c = ::times( &tm );
@@ -118,7 +118,7 @@
}
#endif
-process_user_cpu_clock::time_point process_user_cpu_clock::now() BOOST_CHRONO_NOEXCEPT
+process_user_cpu_clock::time_point process_user_cpu_clock::now() BOOST_NOEXCEPT
{
tms tm;
clock_t c = ::times( &tm );
@@ -194,7 +194,7 @@
}
#endif
-process_system_cpu_clock::time_point process_system_cpu_clock::now() BOOST_CHRONO_NOEXCEPT
+process_system_cpu_clock::time_point process_system_cpu_clock::now() BOOST_NOEXCEPT
{
tms tm;
clock_t c = ::times( &tm );
@@ -270,7 +270,7 @@
}
#endif
-process_cpu_clock::time_point process_cpu_clock::now() BOOST_CHRONO_NOEXCEPT
+process_cpu_clock::time_point process_cpu_clock::now() BOOST_NOEXCEPT
{
tms tm;
clock_t c = ::times( &tm );
Modified: branches/release/boost/chrono/detail/inlined/posix/thread_clock.hpp
==============================================================================
--- branches/release/boost/chrono/detail/inlined/posix/thread_clock.hpp (original)
+++ branches/release/boost/chrono/detail/inlined/posix/thread_clock.hpp 2011-11-25 19:49:13 EST (Fri, 25 Nov 2011)
@@ -19,7 +19,7 @@
namespace boost { namespace chrono {
- thread_clock::time_point thread_clock::now( ) BOOST_CHRONO_NOEXCEPT
+ thread_clock::time_point thread_clock::now( ) BOOST_NOEXCEPT
{
struct timespec ts;
#if defined CLOCK_THREAD_CPUTIME_ID
Modified: branches/release/boost/chrono/detail/inlined/process_cpu_clocks.hpp
==============================================================================
--- branches/release/boost/chrono/detail/inlined/process_cpu_clocks.hpp (original)
+++ branches/release/boost/chrono/detail/inlined/process_cpu_clocks.hpp 2011-11-25 19:49:13 EST (Fri, 25 Nov 2011)
@@ -39,45 +39,7 @@
#include <boost/chrono/detail/inlined/posix/process_cpu_clocks.hpp>
#endif // POSIX
-#if 0
-namespace boost { namespace chrono {
- process_real_cpu_clock::time_point process_real_cpu_clock::now(
- system::error_code & ec)
- {
- process_times t;
- process_clock::now(t, ec);
- return process_real_cpu_clock::time_point(t.real);
- }
-
- process_user_cpu_clock::time_point process_user_cpu_clock::now(
- system::error_code & ec)
- {
- process_times t;
- process_clock::now(t, ec);
- return process_user_cpu_clock::time_point(t.user);
- }
-
- process_system_cpu_clock::time_point process_system_cpu_clock::now(
- system::error_code & ec)
- {
- process_times t;
- process_clock::now(t, ec);
- return process_system_cpu_clock::time_point(t.system);
- }
-
- process_cpu_clock::time_point process_cpu_clock::now(
- system::error_code & ec )
- {
- process_times t;
- process_clock::now(t,ec);
- time_point::rep r(t.real.count(), t.user.count(), t.system.count());
- return time_point(duration(r));
- }
-
-} // namespace chrono
-} // namespace boost
-#endif
#endif
#endif
Modified: branches/release/boost/chrono/detail/inlined/win/chrono.hpp
==============================================================================
--- branches/release/boost/chrono/detail/inlined/win/chrono.hpp (original)
+++ branches/release/boost/chrono/detail/inlined/win/chrono.hpp 2011-11-25 19:49:13 EST (Fri, 25 Nov 2011)
@@ -23,7 +23,7 @@
namespace chrono_detail
{
- BOOST_CHRONO_INLINE double get_nanosecs_per_tic() BOOST_CHRONO_NOEXCEPT
+ BOOST_CHRONO_INLINE double get_nanosecs_per_tic() BOOST_NOEXCEPT
{
boost::detail::win32::LARGE_INTEGER_ freq;
if ( !boost::detail::win32::QueryPerformanceFrequency( &freq ) )
@@ -33,7 +33,7 @@
}
- steady_clock::time_point steady_clock::now() BOOST_CHRONO_NOEXCEPT
+ steady_clock::time_point steady_clock::now() BOOST_NOEXCEPT
{
static double nanosecs_per_tic = chrono_detail::get_nanosecs_per_tic();
@@ -86,7 +86,7 @@
#endif
BOOST_CHRONO_INLINE
- system_clock::time_point system_clock::now() BOOST_CHRONO_NOEXCEPT
+ system_clock::time_point system_clock::now() BOOST_NOEXCEPT
{
boost::detail::win32::FILETIME_ ft;
#if defined(UNDER_CE)
@@ -124,7 +124,7 @@
#endif
BOOST_CHRONO_INLINE
- std::time_t system_clock::to_time_t(const system_clock::time_point& t) BOOST_CHRONO_NOEXCEPT
+ std::time_t system_clock::to_time_t(const system_clock::time_point& t) BOOST_NOEXCEPT
{
__int64 temp = t.time_since_epoch().count();
@@ -139,7 +139,7 @@
}
BOOST_CHRONO_INLINE
- system_clock::time_point system_clock::from_time_t(std::time_t t) BOOST_CHRONO_NOEXCEPT
+ system_clock::time_point system_clock::from_time_t(std::time_t t) BOOST_NOEXCEPT
{
__int64 temp = t;
temp *= 10000000;
Modified: branches/release/boost/chrono/detail/inlined/win/process_cpu_clocks.hpp
==============================================================================
--- branches/release/boost/chrono/detail/inlined/win/process_cpu_clocks.hpp (original)
+++ branches/release/boost/chrono/detail/inlined/win/process_cpu_clocks.hpp 2011-11-25 19:49:13 EST (Fri, 25 Nov 2011)
@@ -27,7 +27,7 @@
namespace chrono
{
-process_real_cpu_clock::time_point process_real_cpu_clock::now() BOOST_CHRONO_NOEXCEPT
+process_real_cpu_clock::time_point process_real_cpu_clock::now() BOOST_NOEXCEPT
{
clock_t c = ::clock();
if ( c == clock_t(-1) ) // error
@@ -62,7 +62,7 @@
}
#endif
-process_user_cpu_clock::time_point process_user_cpu_clock::now() BOOST_CHRONO_NOEXCEPT
+process_user_cpu_clock::time_point process_user_cpu_clock::now() BOOST_NOEXCEPT
{
// note that Windows uses 100 nanosecond ticks for FILETIME
@@ -127,7 +127,7 @@
}
#endif
-process_system_cpu_clock::time_point process_system_cpu_clock::now() BOOST_CHRONO_NOEXCEPT
+process_system_cpu_clock::time_point process_system_cpu_clock::now() BOOST_NOEXCEPT
{
// note that Windows uses 100 nanosecond ticks for FILETIME
@@ -192,7 +192,7 @@
}
#endif
-process_cpu_clock::time_point process_cpu_clock::now() BOOST_CHRONO_NOEXCEPT
+process_cpu_clock::time_point process_cpu_clock::now() BOOST_NOEXCEPT
{
// note that Windows uses 100 nanosecond ticks for FILETIME
Modified: branches/release/boost/chrono/detail/inlined/win/thread_clock.hpp
==============================================================================
--- branches/release/boost/chrono/detail/inlined/win/thread_clock.hpp (original)
+++ branches/release/boost/chrono/detail/inlined/win/thread_clock.hpp 2011-11-25 19:49:13 EST (Fri, 25 Nov 2011)
@@ -68,7 +68,7 @@
}
#endif
-thread_clock::time_point thread_clock::now() BOOST_CHRONO_NOEXCEPT
+thread_clock::time_point thread_clock::now() BOOST_NOEXCEPT
{
// note that Windows uses 100 nanosecond ticks for FILETIME
Modified: branches/release/boost/chrono/detail/is_evenly_divisible_by.hpp
==============================================================================
--- branches/release/boost/chrono/detail/is_evenly_divisible_by.hpp (original)
+++ branches/release/boost/chrono/detail/is_evenly_divisible_by.hpp 2011-11-25 19:49:13 EST (Fri, 25 Nov 2011)
@@ -11,16 +11,18 @@
#include <boost/chrono/config.hpp>
#include <boost/mpl/logical.hpp>
-#include <boost/ratio/ratio.hpp>
-
+#include <boost/ratio/detail/overflow_helpers.hpp>
namespace boost {
namespace chrono {
namespace chrono_detail {
+// template <class R1, class R2>
+// struct is_evenly_divisible_by : public boost::mpl::bool_ < ratio_divide<R1, R2>::type::den == 1 >
+// {};
template <class R1, class R2>
- struct is_evenly_divisible_by : public boost::mpl::bool_ < ratio_divide<R1, R2>::type::den == 1 >
- {};
+ struct is_evenly_divisible_by : public boost::ratio_detail::is_evenly_divisible_by<R1, R2>
+ {};
} // namespace chrono_detail
} // namespace detail
Modified: branches/release/boost/chrono/duration.hpp
==============================================================================
--- branches/release/boost/chrono/duration.hpp (original)
+++ branches/release/boost/chrono/duration.hpp 2011-11-25 19:49:13 EST (Fri, 25 Nov 2011)
@@ -229,7 +229,7 @@
template <class FromDuration, class ToDuration, class Period>
struct duration_cast_aux<FromDuration, ToDuration, Period, true, true>
{
- BOOST_CHRONO_CONSTEXPR ToDuration operator()(const FromDuration& fd) const
+ BOOST_CONSTEXPR ToDuration operator()(const FromDuration& fd) const
{
return ToDuration(static_cast<typename ToDuration::rep>(fd.count()));
}
@@ -244,7 +244,7 @@
template <class FromDuration, class ToDuration, class Period>
struct duration_cast_aux<FromDuration, ToDuration, Period, true, false>
{
- BOOST_CHRONO_CONSTEXPR ToDuration operator()(const FromDuration& fd) const
+ BOOST_CONSTEXPR ToDuration operator()(const FromDuration& fd) const
{
typedef typename common_type<
typename ToDuration::rep,
@@ -263,7 +263,7 @@
template <class FromDuration, class ToDuration, class Period>
struct duration_cast_aux<FromDuration, ToDuration, Period, false, true>
{
- BOOST_CHRONO_CONSTEXPR ToDuration operator()(const FromDuration& fd) const
+ BOOST_CONSTEXPR ToDuration operator()(const FromDuration& fd) const
{
typedef typename common_type<
typename ToDuration::rep,
@@ -283,7 +283,7 @@
template <class FromDuration, class ToDuration, class Period>
struct duration_cast_aux<FromDuration, ToDuration, Period, false, false>
{
- BOOST_CHRONO_CONSTEXPR ToDuration operator()(const FromDuration& fd) const
+ BOOST_CONSTEXPR ToDuration operator()(const FromDuration& fd) const
{
typedef typename common_type<
typename ToDuration::rep,
@@ -306,7 +306,7 @@
Period::num == 1,
Period::den == 1
> Aux;
- BOOST_CHRONO_CONSTEXPR ToDuration operator()(const FromDuration& fd) const
+ BOOST_CONSTEXPR ToDuration operator()(const FromDuration& fd) const
{
return Aux()(fd);
}
@@ -376,13 +376,13 @@
template <class Rep>
struct duration_values
{
- static BOOST_CHRONO_CONSTEXPR Rep zero() {return Rep(0);}
- static BOOST_CHRONO_CONSTEXPR Rep max BOOST_PREVENT_MACRO_SUBSTITUTION ()
+ static BOOST_CONSTEXPR Rep zero() {return Rep(0);}
+ static BOOST_CONSTEXPR Rep max BOOST_PREVENT_MACRO_SUBSTITUTION ()
{
return (std::numeric_limits<Rep>::max)();
}
- static BOOST_CHRONO_CONSTEXPR Rep min BOOST_PREVENT_MACRO_SUBSTITUTION ()
+ static BOOST_CONSTEXPR Rep min BOOST_PREVENT_MACRO_SUBSTITUTION ()
{
return detail::numeric_limits<Rep>::lowest();
}
@@ -429,10 +429,10 @@
rep rep_;
public:
- BOOST_CHRONO_CONSTEXPR
+ BOOST_CONSTEXPR
duration() : rep_(duration_values<rep>::zero()) { }
template <class Rep2>
- BOOST_CHRONO_CONSTEXPR
+ BOOST_CONSTEXPR
explicit duration(const Rep2& r
, typename boost::enable_if <
mpl::and_ <
@@ -448,7 +448,7 @@
>::type* = 0
) : rep_(r) { }
~duration() {} //= default;
- BOOST_CHRONO_CONSTEXPR
+ BOOST_CONSTEXPR
duration(const duration& rhs) : rep_(rhs.rep_) {} // = default;
duration& operator=(const duration& rhs) // = default;
{
@@ -458,7 +458,7 @@
// conversions
template <class Rep2, class Period2>
- BOOST_CHRONO_CONSTEXPR
+ BOOST_CONSTEXPR
duration(const duration<Rep2, Period2>& d
, typename boost::enable_if <
mpl::or_ <
@@ -474,14 +474,14 @@
// observer
- BOOST_CHRONO_CONSTEXPR
+ BOOST_CONSTEXPR
rep count() const {return rep_;}
// arithmetic
- BOOST_CHRONO_CONSTEXPR
+ BOOST_CONSTEXPR
duration operator+() const {return *this;}
- BOOST_CHRONO_CONSTEXPR
+ BOOST_CONSTEXPR
duration operator-() const {return duration(-rep_);}
duration& operator++() {++rep_; return *this;}
duration operator++(int) {return duration(rep_++);}
@@ -506,15 +506,15 @@
}
// 20.9.3.4 duration special values [time.duration.special]
- static BOOST_CHRONO_CONSTEXPR duration zero()
+ static BOOST_CONSTEXPR duration zero()
{
return duration(duration_values<rep>::zero());
}
- static BOOST_CHRONO_CONSTEXPR duration min BOOST_PREVENT_MACRO_SUBSTITUTION ()
+ static BOOST_CONSTEXPR duration min BOOST_PREVENT_MACRO_SUBSTITUTION ()
{
return duration((duration_values<rep>::min)());
}
- static BOOST_CHRONO_CONSTEXPR duration max BOOST_PREVENT_MACRO_SUBSTITUTION ()
+ static BOOST_CONSTEXPR duration max BOOST_PREVENT_MACRO_SUBSTITUTION ()
{
return duration((duration_values<rep>::max)());
}
@@ -527,7 +527,7 @@
// Duration +
template <class Rep1, class Period1, class Rep2, class Period2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2> >::type
operator+(const duration<Rep1, Period1>& lhs,
const duration<Rep2, Period2>& rhs)
@@ -540,7 +540,7 @@
// Duration -
template <class Rep1, class Period1, class Rep2, class Period2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2> >::type
operator-(const duration<Rep1, Period1>& lhs,
const duration<Rep2, Period2>& rhs)
@@ -553,7 +553,7 @@
// Duration *
template <class Rep1, class Period, class Rep2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
typename boost::enable_if <
mpl::and_ <
boost::is_convertible<Rep1, typename common_type<Rep1, Rep2>::type>,
@@ -569,7 +569,7 @@
}
template <class Rep1, class Period, class Rep2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
typename boost::enable_if <
mpl::and_ <
boost::is_convertible<Rep1, typename common_type<Rep1, Rep2>::type>,
@@ -585,7 +585,7 @@
// Duration /
template <class Rep1, class Period, class Rep2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
typename boost::disable_if <boost::chrono::detail::is_duration<Rep2>,
typename boost::chrono::detail::duration_divide_result<
duration<Rep1, Period>, Rep2>::type
@@ -599,7 +599,7 @@
}
template <class Rep1, class Period1, class Rep2, class Period2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
typename common_type<Rep1, Rep2>::type
operator/(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs)
{
@@ -610,7 +610,7 @@
#ifdef BOOST_CHRONO_EXTENSIONS
template <class Rep1, class Rep2, class Period>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
typename boost::disable_if <boost::chrono::detail::is_duration<Rep1>,
typename boost::chrono::detail::duration_divide_result2<
Rep1, duration<Rep2, Period> >::type
@@ -626,7 +626,7 @@
// Duration %
template <class Rep1, class Period, class Rep2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
typename boost::disable_if <boost::chrono::detail::is_duration<Rep2>,
typename boost::chrono::detail::duration_modulo_result<
duration<Rep1, Period>, Rep2>::type
@@ -640,7 +640,7 @@
}
template <class Rep1, class Period1, class Rep2, class Period2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2> >::type
operator%(const duration<Rep1, Period1>& lhs,
const duration<Rep2, Period2>& rhs) {
@@ -700,7 +700,7 @@
// Duration ==
template <class Rep1, class Period1, class Rep2, class Period2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
bool
operator==(const duration<Rep1, Period1>& lhs,
const duration<Rep2, Period2>& rhs)
@@ -712,7 +712,7 @@
// Duration !=
template <class Rep1, class Period1, class Rep2, class Period2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
bool
operator!=(const duration<Rep1, Period1>& lhs,
const duration<Rep2, Period2>& rhs)
@@ -723,7 +723,7 @@
// Duration <
template <class Rep1, class Period1, class Rep2, class Period2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
bool
operator< (const duration<Rep1, Period1>& lhs,
const duration<Rep2, Period2>& rhs)
@@ -735,7 +735,7 @@
// Duration >
template <class Rep1, class Period1, class Rep2, class Period2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
bool
operator> (const duration<Rep1, Period1>& lhs,
const duration<Rep2, Period2>& rhs)
@@ -746,7 +746,7 @@
// Duration <=
template <class Rep1, class Period1, class Rep2, class Period2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
bool
operator<=(const duration<Rep1, Period1>& lhs,
const duration<Rep2, Period2>& rhs)
@@ -771,7 +771,7 @@
// Compile-time select the most efficient algorithm for the conversion...
template <class ToDuration, class Rep, class Period>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
typename boost::enable_if <
boost::chrono::detail::is_duration<ToDuration>, ToDuration>::type
duration_cast(const duration<Rep, Period>& fd)
Modified: branches/release/boost/chrono/process_cpu_clocks.hpp
==============================================================================
--- branches/release/boost/chrono/process_cpu_clocks.hpp (original)
+++ branches/release/boost/chrono/process_cpu_clocks.hpp 2011-11-25 19:49:13 EST (Fri, 25 Nov 2011)
@@ -10,9 +10,9 @@
#ifndef BOOST_CHRONO_PROCESS_CPU_CLOCKS_HPP
#define BOOST_CHRONO_PROCESS_CPU_CLOCKS_HPP
-
#include <boost/chrono/config.hpp>
+
#if defined(BOOST_CHRONO_HAS_PROCESS_CLOCKS)
#include <boost/chrono/duration.hpp>
@@ -39,9 +39,9 @@
typedef duration::rep rep;
typedef duration::period period;
typedef chrono::time_point<process_real_cpu_clock> time_point;
- BOOST_CHRONO_STATIC_CONSTEXPR bool is_steady = true;
+ BOOST_STATIC_CONSTEXPR bool is_steady = true;
- static BOOST_CHRONO_INLINE time_point now() BOOST_CHRONO_NOEXCEPT;
+ static BOOST_CHRONO_INLINE time_point now() BOOST_NOEXCEPT;
#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
static BOOST_CHRONO_INLINE time_point now(system::error_code & ec );
#endif
@@ -53,9 +53,9 @@
typedef duration::rep rep;
typedef duration::period period;
typedef chrono::time_point<process_user_cpu_clock> time_point;
- BOOST_CHRONO_STATIC_CONSTEXPR bool is_steady = true;
+ BOOST_STATIC_CONSTEXPR bool is_steady = true;
- static BOOST_CHRONO_INLINE time_point now() BOOST_CHRONO_NOEXCEPT;
+ static BOOST_CHRONO_INLINE time_point now() BOOST_NOEXCEPT;
#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
static BOOST_CHRONO_INLINE time_point now(system::error_code & ec );
#endif
@@ -67,9 +67,9 @@
typedef duration::rep rep;
typedef duration::period period;
typedef chrono::time_point<process_system_cpu_clock> time_point;
- BOOST_CHRONO_STATIC_CONSTEXPR bool is_steady = true;
+ BOOST_STATIC_CONSTEXPR bool is_steady = true;
- static BOOST_CHRONO_INLINE time_point now() BOOST_CHRONO_NOEXCEPT;
+ static BOOST_CHRONO_INLINE time_point now() BOOST_NOEXCEPT;
#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
static BOOST_CHRONO_INLINE time_point now(system::error_code & ec );
#endif
@@ -234,7 +234,7 @@
namespace chrono
{
template <class Rep1, class Period1, class Rep2, class Period2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
bool
operator==(const duration<process_times<Rep1>, Period1>& lhs,
const duration<process_times<Rep2>, Period2>& rhs)
@@ -244,7 +244,7 @@
}
template <class Rep1, class Period1, class Rep2, class Period2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
bool
operator==(const duration<process_times<Rep1>, Period1>& lhs,
const duration<Rep2, Period2>& rhs)
@@ -254,7 +254,7 @@
}
template <class Rep1, class Period1, class Rep2, class Period2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
bool
operator==(const duration<Rep1, Period1>& lhs,
const duration<process_times<Rep2>, Period2>& rhs)
@@ -266,7 +266,7 @@
// Duration <
template <class Rep1, class Period1, class Rep2, class Period2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
bool
operator< (const duration<process_times<Rep1>, Period1>& lhs,
const duration<Rep2, Period2>& rhs)
@@ -276,7 +276,7 @@
}
template <class Rep1, class Period1, class Rep2, class Period2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
bool
operator< (const duration<Rep1, Period1>& lhs,
const duration<process_times<Rep2>, Period2>& rhs)
@@ -285,7 +285,7 @@
}
template <class Rep1, class Period1, class Rep2, class Period2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
bool
operator< (const duration<process_times<Rep1>, Period1>& lhs,
const duration<process_times<Rep2>, Period2>& rhs)
@@ -305,9 +305,9 @@
typedef duration::rep rep;
typedef duration::period period;
typedef chrono::time_point<process_cpu_clock> time_point;
- BOOST_CHRONO_STATIC_CONSTEXPR bool is_steady = true;
+ BOOST_STATIC_CONSTEXPR bool is_steady = true;
- static BOOST_CHRONO_INLINE time_point now() BOOST_CHRONO_NOEXCEPT;
+ static BOOST_CHRONO_INLINE time_point now() BOOST_NOEXCEPT;
#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
static BOOST_CHRONO_INLINE time_point now(system::error_code & ec );
#endif
Modified: branches/release/boost/chrono/system_clocks.hpp
==============================================================================
--- branches/release/boost/chrono/system_clocks.hpp (original)
+++ branches/release/boost/chrono/system_clocks.hpp 2011-11-25 19:49:13 EST (Fri, 25 Nov 2011)
@@ -95,7 +95,7 @@
// Clocks
class BOOST_CHRONO_DECL system_clock;
#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
- class BOOST_CHRONO_DECL steady_clock; // as permitted by [time.clock.steady]
+ class BOOST_CHRONO_DECL steady_clock;
#endif
#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
@@ -128,15 +128,15 @@
typedef duration::rep rep;
typedef duration::period period;
typedef chrono::time_point<system_clock> time_point;
- BOOST_CHRONO_STATIC_CONSTEXPR bool is_steady = false;
+ BOOST_STATIC_CONSTEXPR bool is_steady = false;
- static BOOST_CHRONO_INLINE time_point now() BOOST_CHRONO_NOEXCEPT;
+ static BOOST_CHRONO_INLINE time_point now() BOOST_NOEXCEPT;
#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
static BOOST_CHRONO_INLINE time_point now(system::error_code & ec);
#endif
- static BOOST_CHRONO_INLINE std::time_t to_time_t(const time_point& t) BOOST_CHRONO_NOEXCEPT;
- static BOOST_CHRONO_INLINE time_point from_time_t(std::time_t t) BOOST_CHRONO_NOEXCEPT;
+ static BOOST_CHRONO_INLINE std::time_t to_time_t(const time_point& t) BOOST_NOEXCEPT;
+ static BOOST_CHRONO_INLINE time_point from_time_t(std::time_t t) BOOST_NOEXCEPT;
};
//----------------------------------------------------------------------------//
@@ -154,9 +154,9 @@
typedef duration::rep rep;
typedef duration::period period;
typedef chrono::time_point<steady_clock> time_point;
- BOOST_CHRONO_STATIC_CONSTEXPR bool is_steady = true;
+ BOOST_STATIC_CONSTEXPR bool is_steady = true;
- static BOOST_CHRONO_INLINE time_point now() BOOST_CHRONO_NOEXCEPT;
+ static BOOST_CHRONO_INLINE time_point now() BOOST_NOEXCEPT;
#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
static BOOST_CHRONO_INLINE time_point now(system::error_code & ec);
#endif
Modified: branches/release/boost/chrono/thread_clock.hpp
==============================================================================
--- branches/release/boost/chrono/thread_clock.hpp (original)
+++ branches/release/boost/chrono/thread_clock.hpp 2011-11-25 19:49:13 EST (Fri, 25 Nov 2011)
@@ -7,12 +7,14 @@
// See http://www.boost.org/libs/system for documentation.
+#include <boost/chrono/config.hpp>
+
#ifndef BOOST_CHRONO_THREAD_CLOCK_HPP
#define BOOST_CHRONO_THREAD_CLOCK_HPP
-#include <boost/chrono/config.hpp>
#if defined(BOOST_CHRONO_HAS_THREAD_CLOCK)
+#include <boost/chrono/config.hpp>
#include <boost/chrono/duration.hpp>
#include <boost/chrono/time_point.hpp>
#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
@@ -33,9 +35,9 @@
typedef duration::rep rep;
typedef duration::period period;
typedef chrono::time_point<thread_clock> time_point;
- BOOST_CHRONO_STATIC_CONSTEXPR bool is_steady = BOOST_CHRONO_THREAD_CLOCK_IS_STEADY;
+ BOOST_STATIC_CONSTEXPR bool is_steady = BOOST_CHRONO_THREAD_CLOCK_IS_STEADY;
- static BOOST_CHRONO_INLINE time_point now( ) BOOST_CHRONO_NOEXCEPT;
+ static BOOST_CHRONO_INLINE time_point now( ) BOOST_NOEXCEPT;
#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
static BOOST_CHRONO_INLINE time_point now( system::error_code & ec );
#endif
Modified: branches/release/boost/chrono/time_point.hpp
==============================================================================
--- branches/release/boost/chrono/time_point.hpp (original)
+++ branches/release/boost/chrono/time_point.hpp 2011-11-25 19:49:13 EST (Fri, 25 Nov 2011)
@@ -78,28 +78,28 @@
// time_point arithmetic
template <class Clock, class Duration1, class Rep2, class Period2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
time_point<Clock,
typename common_type<Duration1, duration<Rep2, Period2> >::type>
operator+(
const time_point<Clock, Duration1>& lhs,
const duration<Rep2, Period2>& rhs);
template <class Rep1, class Period1, class Clock, class Duration2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
time_point<Clock,
typename common_type<duration<Rep1, Period1>, Duration2>::type>
operator+(
const duration<Rep1, Period1>& lhs,
const time_point<Clock, Duration2>& rhs);
template <class Clock, class Duration1, class Rep2, class Period2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
time_point<Clock,
typename common_type<Duration1, duration<Rep2, Period2> >::type>
operator-(
const time_point<Clock, Duration1>& lhs,
const duration<Rep2, Period2>& rhs);
template <class Clock, class Duration1, class Duration2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
typename common_type<Duration1, Duration2>::type
operator-(
const time_point<Clock, Duration1>& lhs,
@@ -108,39 +108,39 @@
// time_point comparisons
template <class Clock, class Duration1, class Duration2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
bool operator==(
const time_point<Clock, Duration1>& lhs,
const time_point<Clock, Duration2>& rhs);
template <class Clock, class Duration1, class Duration2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
bool operator!=(
const time_point<Clock, Duration1>& lhs,
const time_point<Clock, Duration2>& rhs);
template <class Clock, class Duration1, class Duration2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
bool operator< (
const time_point<Clock, Duration1>& lhs,
const time_point<Clock, Duration2>& rhs);
template <class Clock, class Duration1, class Duration2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
bool operator<=(
const time_point<Clock, Duration1>& lhs,
const time_point<Clock, Duration2>& rhs);
template <class Clock, class Duration1, class Duration2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
bool operator> (
const time_point<Clock, Duration1>& lhs,
const time_point<Clock, Duration2>& rhs);
template <class Clock, class Duration1, class Duration2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
bool operator>=(
const time_point<Clock, Duration1>& lhs,
const time_point<Clock, Duration2>& rhs);
// time_point_cast
template <class ToDuration, class Clock, class Duration>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
time_point<Clock, ToDuration> time_point_cast(const time_point<Clock, Duration>& t);
//----------------------------------------------------------------------------//
@@ -165,16 +165,16 @@
duration d_;
public:
- BOOST_CHRONO_CONSTEXPR
+ BOOST_CONSTEXPR
time_point() : d_(duration::zero())
{}
- BOOST_CHRONO_CONSTEXPR explicit time_point(const duration& d)
+ BOOST_CONSTEXPR explicit time_point(const duration& d)
: d_(d)
{}
// conversions
template <class Duration2>
- BOOST_CHRONO_CONSTEXPR
+ BOOST_CONSTEXPR
time_point(const time_point<clock, Duration2>& t
, typename boost::enable_if
<
@@ -186,7 +186,7 @@
}
// observer
- BOOST_CHRONO_CONSTEXPR
+ BOOST_CONSTEXPR
duration time_since_epoch() const
{
return d_;
@@ -195,9 +195,9 @@
// arithmetic
#ifdef BOOST_CHRONO_EXTENSIONS
- BOOST_CHRONO_CONSTEXPR
+ BOOST_CONSTEXPR
time_point operator+() const {return *this;}
- BOOST_CHRONO_CONSTEXPR
+ BOOST_CONSTEXPR
time_point operator-() const {return time_point(-d_);}
time_point& operator++() {++d_; return *this;}
time_point operator++(int) {return time_point(d_++);}
@@ -214,12 +214,12 @@
// special values
- static BOOST_CHRONO_CONSTEXPR time_point
+ static BOOST_CONSTEXPR time_point
min BOOST_PREVENT_MACRO_SUBSTITUTION ()
{
return time_point((duration::min)());
}
- static BOOST_CHRONO_CONSTEXPR time_point
+ static BOOST_CONSTEXPR time_point
max BOOST_PREVENT_MACRO_SUBSTITUTION ()
{
return time_point((duration::max)());
@@ -233,7 +233,7 @@
// time_point operator+(time_point x, duration y);
template <class Clock, class Duration1, class Rep2, class Period2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
time_point<Clock,
typename common_type<Duration1, duration<Rep2, Period2> >::type>
operator+(const time_point<Clock, Duration1>& lhs,
@@ -250,7 +250,7 @@
// time_point operator+(duration x, time_point y);
template <class Rep1, class Period1, class Clock, class Duration2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
time_point<Clock,
typename common_type<duration<Rep1, Period1>, Duration2>::type>
operator+(const duration<Rep1, Period1>& lhs,
@@ -262,7 +262,7 @@
// time_point operator-(time_point x, duration y);
template <class Clock, class Duration1, class Rep2, class Period2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
time_point<Clock,
typename common_type<Duration1, duration<Rep2, Period2> >::type>
operator-(const time_point<Clock, Duration1>& lhs,
@@ -274,7 +274,7 @@
// duration operator-(time_point x, time_point y);
template <class Clock, class Duration1, class Duration2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
typename common_type<Duration1, Duration2>::type
operator-(const time_point<Clock, Duration1>& lhs,
const time_point<Clock, Duration2>& rhs)
@@ -289,7 +289,7 @@
// time_point ==
template <class Clock, class Duration1, class Duration2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
bool
operator==(const time_point<Clock, Duration1>& lhs,
const time_point<Clock, Duration2>& rhs)
@@ -300,7 +300,7 @@
// time_point !=
template <class Clock, class Duration1, class Duration2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
bool
operator!=(const time_point<Clock, Duration1>& lhs,
const time_point<Clock, Duration2>& rhs)
@@ -311,7 +311,7 @@
// time_point <
template <class Clock, class Duration1, class Duration2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
bool
operator<(const time_point<Clock, Duration1>& lhs,
const time_point<Clock, Duration2>& rhs)
@@ -322,7 +322,7 @@
// time_point >
template <class Clock, class Duration1, class Duration2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
bool
operator>(const time_point<Clock, Duration1>& lhs,
const time_point<Clock, Duration2>& rhs)
@@ -333,7 +333,7 @@
// time_point <=
template <class Clock, class Duration1, class Duration2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
bool
operator<=(const time_point<Clock, Duration1>& lhs,
const time_point<Clock, Duration2>& rhs)
@@ -344,7 +344,7 @@
// time_point >=
template <class Clock, class Duration1, class Duration2>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
bool
operator>=(const time_point<Clock, Duration1>& lhs,
const time_point<Clock, Duration2>& rhs)
@@ -357,7 +357,7 @@
//----------------------------------------------------------------------------//
template <class ToDuration, class Clock, class Duration>
- inline BOOST_CHRONO_CONSTEXPR
+ inline BOOST_CONSTEXPR
time_point<Clock, ToDuration>
time_point_cast(const time_point<Clock, Duration>& t)
{
Modified: branches/release/boost/ratio/detail/overflow_helpers.hpp
==============================================================================
--- branches/release/boost/ratio/detail/overflow_helpers.hpp (original)
+++ branches/release/boost/ratio/detail/overflow_helpers.hpp 2011-11-25 19:49:13 EST (Fri, 25 Nov 2011)
@@ -216,7 +216,7 @@
template <class R1, class R2> struct ratio_subtract;
template <class R1, class R2> struct ratio_multiply;
template <class R1, class R2> struct ratio_divide;
-
+
template <class R1, class R2>
struct ratio_add
{
@@ -242,6 +242,11 @@
>
>::type type;
};
+ template <class R, boost::intmax_t D>
+ struct ratio_add<R, ratio<0,D> >
+ {
+ typedef R type;
+ };
template <class R1, class R2>
struct ratio_subtract
@@ -269,6 +274,12 @@
>::type type;
};
+ template <class R, boost::intmax_t D>
+ struct ratio_subtract<R, ratio<0,D> >
+ {
+ typedef R type;
+ };
+
template <class R1, class R2>
struct ratio_multiply
{
@@ -300,12 +311,23 @@
boost::ratio_detail::br_mul<R2::num / gcd_n1_n2, R1::den / gcd_d1_d2>::value
>::type type;
};
-
+ template <class R1, class R2>
+ struct is_evenly_divisible_by
+ {
+ private:
+ static const boost::intmax_t gcd_n1_n2 = mpl::gcd_c<boost::intmax_t, R1::num, R2::num>::value;
+ static const boost::intmax_t gcd_d1_d2 = mpl::gcd_c<boost::intmax_t, R1::den, R2::den>::value;
+ public:
+ typedef integral_constant<bool,
+ ((R2::num / gcd_n1_n2 ==1) && (R1::den / gcd_d1_d2)==1)
+ > type;
+ };
+
template <class T>
- struct is_ratio : public boost::false_type
+ struct is_ratio : public boost::false_type
{};
template <boost::intmax_t N, boost::intmax_t D>
- struct is_ratio<ratio<N, D> > : public boost::true_type
+ struct is_ratio<ratio<N, D> > : public boost::true_type
{};
template <class R1, class R2,
@@ -339,11 +361,11 @@
{
static const bool value = ratio_less1<ratio<R2::den, M2>, ratio<R1::den, M1>
>::value;
- };
-
+ };
+
template <
- class R1,
- class R2,
+ class R1,
+ class R2,
boost::intmax_t S1 = mpl::sign_c<boost::intmax_t, R1::num>::value,
boost::intmax_t S2 = mpl::sign_c<boost::intmax_t, R2::num>::value
>
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