From 9f8823aebfeff42ba33a6bb9b8248993a3963feb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tolga=20HO=C5=9EG=C3=96R?= Date: Tue, 27 Sep 2016 09:51:09 +0300 Subject: [PATCH] Fixed #24 --- include/boost/optional/detail/optional_reference_spec.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/boost/optional/detail/optional_reference_spec.hpp b/include/boost/optional/detail/optional_reference_spec.hpp index ad286ff..ce55875 100644 --- a/include/boost/optional/detail/optional_reference_spec.hpp +++ b/include/boost/optional/detail/optional_reference_spec.hpp @@ -127,8 +127,8 @@ public: optional(none_t) BOOST_NOEXCEPT : ptr_() {} template - explicit optional(const optional& rhs) BOOST_NOEXCEPT : ptr_(rhs.ptr_) {} - optional(const optional& rhs) BOOST_NOEXCEPT : ptr_(rhs.ptr_) {} + explicit optional(const optional& rhs) BOOST_NOEXCEPT : ptr_(rhs.get_ptr()) {} + optional(const optional& rhs) BOOST_NOEXCEPT : ptr_(rhs.get_ptr()) {} // the following two implement a 'conditionally explicit' constructor: condition is a hack for buggy compilers with srewed conversion construction from const int template @@ -139,9 +139,9 @@ public: optional(U& rhs, BOOST_DEDUCED_TYPENAME boost::enable_if_c::value && !detail::is_const_integral_bad_for_conversion::value>::type* = 0) BOOST_NOEXCEPT : ptr_(boost::addressof(rhs)) {} - optional& operator=(const optional& rhs) BOOST_NOEXCEPT { ptr_ = rhs.ptr_; return *this; } + optional& operator=(const optional& rhs) BOOST_NOEXCEPT { ptr_ = rhs.get_ptr(); return *this; } template - optional& operator=(const optional& rhs) BOOST_NOEXCEPT { ptr_ = rhs.ptr_; return *this; } + optional& operator=(const optional& rhs) BOOST_NOEXCEPT { ptr_ = rhs.get_ptr(); return *this; } optional& operator=(none_t) BOOST_NOEXCEPT { ptr_ = 0; return *this; }