mirror of
https://github.com/boostorg/optional.git
synced 2025-07-23 09:07:17 +02:00
fixed optional<optional<T>&> case
This commit is contained in:
@ -96,6 +96,7 @@ public:
|
||||
template <class U>
|
||||
explicit optional(const optional<U&>& rhs) BOOST_NOEXCEPT : ptr_(rhs.ptr_) {}
|
||||
optional(const optional& rhs) BOOST_NOEXCEPT : ptr_(rhs.ptr_) {}
|
||||
optional(T& rhs) BOOST_NOEXCEPT : ptr_(boost::addressof(rhs)) {}
|
||||
|
||||
|
||||
optional& operator=(const optional& rhs) BOOST_NOEXCEPT { ptr_ = rhs.ptr_; return *this; }
|
||||
@ -121,6 +122,8 @@ public:
|
||||
|
||||
#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
|
||||
|
||||
optional(T&& rhs) BOOST_NOEXCEPT { detail::prevent_binding_rvalue<T&&>(); }
|
||||
|
||||
template <class R>
|
||||
optional(R&& r, BOOST_DEDUCED_TYPENAME boost::enable_if<detail::is_no_optional<R> >::type* = 0) BOOST_NOEXCEPT
|
||||
: ptr_(boost::addressof(r)) { detail::prevent_binding_rvalue<R>(); }
|
||||
|
Reference in New Issue
Block a user