Issue 2401: std::function needs more noexcept (original) (raw)
This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++17 status.
2401. std::function needs more noexcept
Section: 22.10.17.3 [func.wrap.func] Status: C++17 Submitter: Stephan T. Lavavej Opened: 2014-06-14 Last modified: 2017-07-30
Priority: 0
View all other issues in [func.wrap.func].
View all issues with C++17 status.
Discussion:
There are two issues here:
std::function's constructor fromnullptr_tis marked asnoexcept, but its assignment operator fromnullptr_tisn't. This assignment can and should be marked asnoexcept.std::function's comparisons withnullptr_tare marked asnoexceptin two out of three places.
[2014-06-16 Rapperswil]
Move to Ready
Proposed resolution:
This wording is relative to N3936.
- Change 22.10 [function.objects] p2, header
<functional>synopsis, as indicated:namespace std {
[…]
// 20.9.11 polymorphic function wrappers:
[…]
template<class R, class... ArgTypes>
bool operator==(const function<R(ArgTypes...)>&, nullptr_t) noexcept;
template<class R, class... ArgTypes>
bool operator==(nullptr_t, const function<R(ArgTypes...)>&) noexcept;
template<class R, class... ArgTypes>
bool operator!=(const function<R(ArgTypes...)>&, nullptr_t) noexcept;
template<class R, class... ArgTypes>
bool operator!=(nullptr_t, const function<R(ArgTypes...)>&) noexcept;
[…]
} - Change 22.10.17.3 [func.wrap.func], class template
functionsynopsis, as indicated:[…]
// 20.9.11.2.1, construct/copy/destroy:
[…]
function& operator=(nullptr_t) noexcept;
[…] - Change 22.10.17.3.2 [func.wrap.func.con] before p16 as indicated:
function& operator=(nullptr_t) noexcept;