@@ -614,7 +614,7 @@ class in_place_storage
614614 *
615615 * \return Reference to the current storage.
616616 */
617- in_place_storage& operator =(in_place_storage&& other)
617+ in_place_storage& operator =(in_place_storage&& other) noexcept (std::is_nothrow_move_constructible<T>::value)
618618 {
619619 new (&m_inPlace) T (std::move (*other.getObject ()));
620620 other.getObject ()->~T (); // ensure that destructor of object in original storage is called
@@ -629,7 +629,8 @@ class in_place_storage
629629 *
630630 * \return Reference to the current storage.
631631 */
632- in_place_storage& assign (NoInitT, in_place_storage&& other)
632+ in_place_storage& assign (NoInitT, in_place_storage&& other) noexcept (
633+ std::is_nothrow_move_constructible<T>::value)
633634 {
634635 new (&m_inPlace) T (NoInit, std::move (*other.getObject ()));
635636 other.getObject ()->~T (); // ensure that destructor of object in original storage is called
@@ -714,7 +715,7 @@ class inplace_optional_holder : public optional_holder_base<T, inplace_optional_
714715 *
715716 * \param val Value to store in the holder.
716717 */
717- inplace_optional_holder (T&& val)
718+ inplace_optional_holder (T&& val) noexcept (std::is_nothrow_constructible<T>::value)
718719 {
719720 new (m_storage.getStorage ()) T (std::move (val));
720721 m_hasValue = true ;
@@ -728,7 +729,7 @@ class inplace_optional_holder : public optional_holder_base<T, inplace_optional_
728729 */
729730 template <typename U = T,
730731 typename std::enable_if<std::is_constructible<U, NoInitT, U>::value, int >::type = 0 >
731- inplace_optional_holder (NoInitT, T&& val)
732+ inplace_optional_holder (NoInitT, T&& val) noexcept (std::is_nothrow_move_constructible<T>::value)
732733 {
733734 new (m_storage.getStorage ()) T (NoInit, std::move (val));
734735 m_hasValue = true ;
@@ -770,7 +771,7 @@ class inplace_optional_holder : public optional_holder_base<T, inplace_optional_
770771 * \param other Other holder to move.
771772 */
772773 inplace_optional_holder (inplace_optional_holder&& other) noexcept (
773- std::is_nothrow_move_constructible <in_place_storage<T>>::value)
774+ std::is_nothrow_move_assignable <in_place_storage<T>>::value)
774775 {
775776 if (other.hasValue ())
776777 {
@@ -788,7 +789,7 @@ class inplace_optional_holder : public optional_holder_base<T, inplace_optional_
788789 template <typename U = T,
789790 typename std::enable_if<std::is_constructible<U, NoInitT, U>::value, int >::type = 0 >
790791 inplace_optional_holder (NoInitT, inplace_optional_holder&& other) noexcept (
791- std::is_nothrow_move_constructible <in_place_storage<T>>::value)
792+ std::is_nothrow_move_assignable <in_place_storage<T>>::value)
792793 {
793794 if (other.hasValue ())
794795 {
@@ -871,7 +872,8 @@ class inplace_optional_holder : public optional_holder_base<T, inplace_optional_
871872 *
872873 * \return Reference to the current holder.
873874 */
874- inplace_optional_holder& operator =(inplace_optional_holder&& other)
875+ inplace_optional_holder& operator =(inplace_optional_holder&& other) noexcept (
876+ std::is_nothrow_move_assignable<in_place_storage<T>>::value)
875877 {
876878 if (this != &other)
877879 {
@@ -896,7 +898,8 @@ class inplace_optional_holder : public optional_holder_base<T, inplace_optional_
896898 */
897899 template <typename U = T,
898900 typename std::enable_if<std::is_constructible<U, NoInitT, U>::value, int >::type = 0 >
899- inplace_optional_holder& assign (NoInitT, inplace_optional_holder&& other)
901+ inplace_optional_holder& assign (NoInitT, inplace_optional_holder&& other) noexcept (
902+ std::is_nothrow_move_assignable<in_place_storage<T>>::value)
900903 {
901904 if (this != &other)
902905 {
0 commit comments