Index: detail/inlined/win/chrono.hpp =================================================================== --- detail/inlined/win/chrono.hpp (revision 69105) +++ detail/inlined/win/chrono.hpp (working copy) @@ -52,15 +52,8 @@ "chrono::steady_clock" )); } -#if defined(BOOST_MSVC) && (BOOST_MSVC == 1500) - // trying to simplify expression (Pb. with MSVC.9.0) - steady_clock::rep r = static_cast((nanosecs_per_tic) * pcount.QuadPart); - steady_clock::duration d(r); - return steady_clock::time_point(d); -#else return steady_clock::time_point(steady_clock::duration( static_cast((nanosecs_per_tic) * pcount.QuadPart))); -#endif } Index: detail/is_evenly_divisible_by.hpp =================================================================== --- detail/is_evenly_divisible_by.hpp (revision 0) +++ detail/is_evenly_divisible_by.hpp (revision 0) @@ -0,0 +1,29 @@ +// is_evenly_divisible_by.hpp --------------------------------------------------------------// + +// Copyright 2009-2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +#ifndef BOOST_CHRONO_DETAIL_IS_EVENLY_DIVISIBLE_BY_HPP +#define BOOST_CHRONO_DETAIL_IS_EVENLY_DIVISIBLE_BY_HPP + +#include + +#include +#include + + +namespace boost { +namespace chrono { +namespace chrono_detail { + + template + struct is_evenly_divisible_by : public boost::mpl::bool_ < ratio_divide::type::den == 1 > + {}; + +} // namespace chrono_detail +} // namespace detail +} // namespace chrono + +#endif // BOOST_CHRONO_DETAIL_IS_EVENLY_DIVISIBLE_BY_HPP Index: duration.hpp =================================================================== --- duration.hpp (revision 69105) +++ duration.hpp (working copy) @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -432,8 +433,6 @@ template BOOST_CHRONO_CONSTEXPR explicit duration(const Rep2& r -#if defined(BOOST_MSVC) && (BOOST_MSVC == 1500) -#else , typename boost::enable_if < mpl::and_ < boost::is_convertible, @@ -446,8 +445,7 @@ > > >::type* = 0 -#endif - ) + ) : rep_(r) { } ~duration() {} //= default; duration(const duration& rhs) : rep_(rhs.rep_) {} // = default; @@ -461,19 +459,16 @@ template BOOST_CHRONO_CONSTEXPR duration(const duration& d -#if defined(BOOST_MSVC) && (BOOST_MSVC == 1500) -#else , typename boost::enable_if < mpl::or_ < treat_as_floating_point, mpl::and_ < - mpl::bool_ < ratio_divide::type::den == 1>, + chrono_detail::is_evenly_divisible_by, mpl::not_ < treat_as_floating_point > > > >::type* = 0 -#endif - ) + ) : rep_(chrono::detail::duration_cast, duration>()(d).count()) {} // observer @@ -560,9 +555,6 @@ template inline -#if defined(BOOST_MSVC) && (BOOST_MSVC == 1500) - duration::type, Period> -#else typename boost::enable_if < mpl::and_ < boost::is_convertible::type>, @@ -570,7 +562,6 @@ >, duration::type, Period> >::type -#endif operator*(const duration& d, const Rep2& s) { typedef typename common_type::type CR; @@ -581,9 +572,6 @@ template inline -#if defined(BOOST_MSVC) && (BOOST_MSVC == 1500) - duration::type, Period> -#else typename boost::enable_if < mpl::and_ < boost::is_convertible::type>, @@ -591,7 +579,6 @@ >, duration::type, Period> >::type -#endif operator*(const Rep1& s, const duration& d) { return d * s; @@ -676,15 +663,7 @@ bool operator()(const LhsDuration& lhs, const RhsDuration& rhs) { typedef typename common_type::type CD; -#if defined(BOOST_MSVC) && (BOOST_MSVC == 1500) - // trying to simplify expression so enable_if is not used (Pb. with MSVC.9.0) - return - chrono::detail::duration_cast()(lhs).count() - == - chrono::detail::duration_cast()(rhs).count(); -#else return CD(lhs).count() == CD(rhs).count(); -#endif } }; @@ -703,15 +682,7 @@ bool operator()(const LhsDuration& lhs, const RhsDuration& rhs) { typedef typename common_type::type CD; -#if defined(BOOST_MSVC) && (BOOST_MSVC == 1500) - // trying to simplify expression so enable_if is not used (Pb. with MSVC.9.0) - return - chrono::detail::duration_cast()(lhs).count() - < - chrono::detail::duration_cast()(rhs).count(); -#else return CD(lhs).count() < CD(rhs).count(); -#endif } }; @@ -801,12 +772,8 @@ // Compile-time select the most efficient algorithm for the conversion... template inline BOOST_CHRONO_CONSTEXPR -#if defined(BOOST_MSVC) && (BOOST_MSVC == 1500) - ToDuration -#else typename boost::enable_if < boost::chrono::detail::is_duration, ToDuration>::type -#endif duration_cast(const duration& fd) { return boost::chrono::detail::duration_cast< Index: time_point.hpp =================================================================== --- time_point.hpp (revision 69105) +++ time_point.hpp (working copy) @@ -170,13 +170,10 @@ template BOOST_CHRONO_CONSTEXPR time_point(const time_point& t -#if defined(BOOST_MSVC) && (BOOST_MSVC == 1500) -#else , typename boost::enable_if < boost::is_convertible >::type* = 0 -#endif ) : d_(t.time_since_epoch()) {