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.
Section: 188.8.131.52 [optional.swap], 19.6.9 [optional.specalg] Status: C++17 Submitter: Agustín K-ballo Bergé Opened: 2016-07-19 Last modified: 2019-01-01
View all issues with C++17 status.
optional didn't benefit from the wording modifications by P0185 "Adding [nothrow_]swappable traits"; as such, it suffers from LWG 2456, and does not play nice with swappable traits.
Monday: P0 - tentatively ready
This wording is relative to N4606.
Modify [optional.object.swap] as indicated:
void swap(optional<T>& rhs) noexcept(see below);
[…]-4- Remarks: The expression inside noexcept is equivalent to:is_nothrow_move_constructible_v<T> &&
Modify 19.6.9 [optional.specalg] as indicated:
template <class T> void swap(optional<T>& x, optional<T>& y) noexcept(noexcept(x.swap(y)));
-1- Effects: Calls x.swap(y).