Created on 2025-10-31.00:00:00 last changed 1 week ago
Proposed resolution:
This wording is relative to N5014.
Modify [optional.ref.swap] as indicated:
constexpr void swap(optional& rhs) noexcept;-1- Effects: Equivalent to: std::swap(val, rhs.val).
[ Kona 2025-11-08; Status changed: Immediate → WP. ]
[ Kona 2025-11-07; approved by LWG. Status changed: New → Immediate. ]
Currently, [optional.ref.swap] p1 specifies an "unqualified" `swap` call, which possibly selects an ADL-found swap function due to [contents] and [swappable.requirements].
It's unlike to be intentional to call ADL-found `swap` on pointers (given `ranges::swap` doesn't), and the unconditional `noexcept` also suggests that user-provided `swap` functions shouldn't interfere with optional<T&>::swap.| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2025-11-11 10:48:55 | admin | set | messages: + msg15692 |
| 2025-11-11 10:48:55 | admin | set | status: immediate -> wp |
| 2025-11-07 19:33:31 | admin | set | messages: + msg15596 |
| 2025-11-07 19:33:31 | admin | set | status: new -> immediate |
| 2025-10-31 12:08:12 | admin | set | messages: + msg15479 |
| 2025-10-31 00:00:00 | admin | create | |