Created on 2016-07-19.00:00:00 last changed 90 months ago
Proposed resolution:
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> && is_nothrow_swappable_v<T>noexcept(swap(declval<T&>(), declval<T&>()))
Modify [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).
-?- Remarks: This function shall not participate in overload resolution unless is_move_constructible_v<T> is true and is_swappable_v<T> is true.
[ 2016-07 Chicago ]
Monday: P0 - tentatively ready
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.
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-07-30 20:15:43 | admin | set | status: wp -> c++17 |
2016-11-14 03:59:28 | admin | set | status: pending -> wp |
2016-11-14 03:55:22 | admin | set | status: ready -> pending |
2016-08-01 18:34:48 | admin | set | messages: + msg8286 |
2016-08-01 18:34:48 | admin | set | status: new -> ready |
2016-07-26 18:35:27 | admin | set | messages: + msg8253 |
2016-07-19 00:00:00 | admin | create |