22 General utilities library [utilities]

22.8 Expected objects [expected]

22.8.3 Class template unexpected [expected.unexpected]

22.8.3.4 Swap [expected.un.swap]

constexpr void swap(unexpected& other) noexcept(is_nothrow_swappable_v<E>);
Mandates: is_­swappable_­v<E> is true.
Effects: Equivalent to: using std​::​swap; swap(val, other.val);
friend constexpr void swap(unexpected& x, unexpected& y) noexcept(noexcept(x.swap(y)));
Constraints: is_­swappable_­v<E> is true.
Effects: Equivalent to x.swap(y).