Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63257 - sandbox/chrono/boost/chrono
From: vicente.botet_at_[hidden]
Date: 2010-06-23 03:27:57


Author: viboes
Date: 2010-06-23 03:27:55 EDT (Wed, 23 Jun 2010)
New Revision: 63257
URL: http://svn.boost.org/trac/boost/changeset/63257

Log:
fix operator= bug as rep_ can be uninitialized
Text files modified:
   sandbox/chrono/boost/chrono/chrono.hpp | 6 ++++--
   1 files changed, 4 insertions(+), 2 deletions(-)

Modified: sandbox/chrono/boost/chrono/chrono.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/chrono.hpp (original)
+++ sandbox/chrono/boost/chrono/chrono.hpp 2010-06-23 03:27:55 EDT (Wed, 23 Jun 2010)
@@ -518,7 +518,9 @@
         rep rep_;
     public:
 
- BOOST_CHRONO_CONSTEXPR duration() { } // = default;
+ BOOST_CHRONO_CONSTEXPR duration() :
+ //~ rep_(duration_values<rep>::zero())
+ { } // = default;
         template <class Rep2>
         BOOST_CHRONO_CONSTEXPR explicit duration(const Rep2& r,
             typename boost::enable_if_c
@@ -535,7 +537,7 @@
         duration(const duration& rhs) : rep_(rhs.rep_) {} // = default;
         duration& operator=(const duration& rhs) // = default;
         {
- if (rhs != *this) rep_= rhs.rep_;
+ if (&rhs != this) rep_= rhs.rep_;
             return *this;
         }
 


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