Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74686 - trunk/boost/chrono
From: vicente.botet_at_[hidden]
Date: 2011-10-04 06:18:18


Author: viboes
Date: 2011-10-04 06:18:17 EDT (Tue, 04 Oct 2011)
New Revision: 74686
URL: http://svn.boost.org/trac/boost/changeset/74686

Log:
Chrono: cleanup
Text files modified:
   trunk/boost/chrono/duration.hpp | 45 +--------------------------------------
   trunk/boost/chrono/time_point.hpp | 6 -----
   2 files changed, 2 insertions(+), 49 deletions(-)

Modified: trunk/boost/chrono/duration.hpp
==============================================================================
--- trunk/boost/chrono/duration.hpp (original)
+++ trunk/boost/chrono/duration.hpp 2011-10-04 06:18:17 EDT (Tue, 04 Oct 2011)
@@ -534,13 +534,7 @@
     {
       typedef typename common_type<duration<Rep1, Period1>,
         duration<Rep2, Period2> >::type CD;
-#if 0
- CD result = lhs;
- result += rhs;
- return result;
-#else
       return CD(CD(lhs).count()+CD(rhs).count());
-#endif
     }
 
     // Duration -
@@ -553,13 +547,7 @@
     {
       typedef typename common_type<duration<Rep1, Period1>,
             duration<Rep2, Period2> >::type CD;
-#if 0
- CD result = lhs;
- result -= rhs;
- return result;
-#else
       return CD(CD(lhs).count()-CD(rhs).count());
-#endif
     }
 
     // Duration *
@@ -577,13 +565,7 @@
     {
       typedef typename common_type<Rep1, Rep2>::type CR;
       typedef duration<CR, Period> CD;
-#if 0
- CD r = d;
- r *= static_cast<CR>(s);
- return r;
-#else
       return CD(CD(d).count()*static_cast<CR>(s));
-#endif
     }
 
     template <class Rep1, class Period, class Rep2>
@@ -613,13 +595,7 @@
         typedef typename common_type<Rep1, Rep2>::type CR;
         typedef duration<CR, Period> CD;
 
-#if 0
- CD r = d;
- r /= static_cast<CR>(s);
- return r;
-#else
       return CD(CD(d).count()/static_cast<CR>(s));
-#endif
     }
 
     template <class Rep1, class Period1, class Rep2, class Period2>
@@ -644,12 +620,7 @@
         typedef typename common_type<Rep1, Rep2>::type CR;
         typedef duration<CR, Period> CD;
 
-#if 0
- CD r = d;
- return static_cast<CR>(s)/r.count();
-#else
       return static_cast<CR>(s)/CD(d).count();
-#endif
     }
     #endif
     // Duration %
@@ -665,14 +636,8 @@
         typedef typename common_type<Rep1, Rep2>::type CR;
         typedef duration<CR, Period> CD;
 
-#if 0
- CD r = d;
- r %= static_cast<CR>(s);
- return r;
-#else
       return CD(CD(d).count()%static_cast<CR>(s));
-#endif
- }
+ }
 
     template <class Rep1, class Period1, class Rep2, class Period2>
     inline BOOST_CHRONO_CONSTEXPR
@@ -682,14 +647,8 @@
         typedef typename common_type<duration<Rep1, Period1>,
                                  duration<Rep2, Period2> >::type CD;
 
-#if 0
- CD r(lhs);
- r%=CD(rhs);
- return r;
-#else
       return CD(CD(lhs).count()%CD(rhs).count());
-#endif
- }
+ }
 
 
 //----------------------------------------------------------------------------//

Modified: trunk/boost/chrono/time_point.hpp
==============================================================================
--- trunk/boost/chrono/time_point.hpp (original)
+++ trunk/boost/chrono/time_point.hpp 2011-10-04 06:18:17 EDT (Tue, 04 Oct 2011)
@@ -244,13 +244,7 @@
           Clock,
           CDuration
> TimeResult;
-#if 0
- TimeResult r(lhs);
- r += rhs;
- return r;
-#else
         return TimeResult(lhs.time_since_epoch() + CDuration(rhs));
-#endif
     }
 
     // time_point operator+(duration x, time_point y);


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