Boost logo

Boost-Commit :

From: fernando.cacciola_at_[hidden]
Date: 2007-11-25 15:26:15


Author: fcacciola
Date: 2007-11-25 15:26:14 EST (Sun, 25 Nov 2007)
New Revision: 41381
URL: http://svn.boost.org/trac/boost/changeset/41381

Log:
Cast to base added to avoid a call to the convertir constructor/assignment (see Tickes 1419 and 1420)
Text files modified:
   trunk/boost/optional/optional.hpp | 4 ++--
   1 files changed, 2 insertions(+), 2 deletions(-)

Modified: trunk/boost/optional/optional.hpp
==============================================================================
--- trunk/boost/optional/optional.hpp (original)
+++ trunk/boost/optional/optional.hpp 2007-11-25 15:26:14 EST (Sun, 25 Nov 2007)
@@ -516,7 +516,7 @@
 
     // Creates a deep copy of another optional<T>
     // Can throw if T::T(T const&) does
- optional ( optional const& rhs ) : base(rhs) {}
+ optional ( optional const& rhs ) : base( static_cast<base const&>(rhs) ) {}
 
    // No-throw (assuming T::~T() doesn't)
     ~optional() {}
@@ -550,7 +550,7 @@
     // (NOTE: On BCB, this operator is not actually called and left is left UNMODIFIED in case of a throw)
     optional& operator= ( optional const& rhs )
       {
- this->assign( rhs ) ;
+ this->assign( static_cast<base const&>(rhs) ) ;
         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