Re: [Boost-bugs] [Boost C++ Libraries] #11927: optional_test_swap.cpp: In C++11 mode, std::swap should have a noexcept specification

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #11927: optional_test_swap.cpp: In C++11 mode, std::swap should have a noexcept specification
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-02-15 09:04:09


#11927: optional_test_swap.cpp: In C++11 mode, std::swap should have a noexcept
specification
--------------------------------------------+-----------------------
  Reporter: Aparna Kumta <aparna.kumta@…> | Owner: fcacciola
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: optional
   Version: Boost Development Trunk | Severity: Problem
Resolution: | Keywords:
--------------------------------------------+-----------------------

Comment (by anonymous):

 In C++11 std::swap has the following noexcept specification (20.2.2
 [utility.swap]):

 {{{
 noexcept(is_nothrow_move_constructible<T>::value &&
          is_nothrow_move_assignable<T>::value
 }}}

 Because {{{optional_swap_test::class_without_default_ctor}}} has a
 throwing move assignment, therefore the non-specialized instantiation of
 std::swap for {{{class_without_default_ctor}}} is {{{noexcept(false)}}}.
 The explicit specialization in file {{{optional_test_swap.cpp}}} is
 correct not to provide {{{noexcept}}} specification.

 My guess is that the compiler gets the {{{is_nothrow_move_assignable}}}
 wrong.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11927#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:19 UTC