From 95c864e119314a2611f283a040294c7c8a234d90 Mon Sep 17 00:00:00 2001 From: Fernando Cacciola Date: Sun, 25 Nov 2007 20:26:14 +0000 Subject: [PATCH] Cast to base added to avoid a call to the convertir constructor/assignment (see Tickes 1419 and 1420) [SVN r41381] --- include/boost/optional/optional.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/optional/optional.hpp b/include/boost/optional/optional.hpp index 42277ba..ebcf17a 100644 --- a/include/boost/optional/optional.hpp +++ b/include/boost/optional/optional.hpp @@ -516,7 +516,7 @@ class optional : public optional_detail::optional_base // Creates a deep copy of another optional // Can throw if T::T(T const&) does - optional ( optional const& rhs ) : base(rhs) {} + optional ( optional const& rhs ) : base( static_cast(rhs) ) {} // No-throw (assuming T::~T() doesn't) ~optional() {} @@ -550,7 +550,7 @@ class optional : public optional_detail::optional_base // (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(rhs) ) ; return *this ; }