20 General utilities library [utilities]

20.5 Tuples [tuple]

20.5.3 Class template tuple [tuple.tuple]

20.5.3.3 swap [tuple.swap]

constexpr void swap(tuple& rhs) noexcept(see below); constexpr void swap(const tuple& rhs) const noexcept(see below);
Mandates:
  • For the first overload, (is_­swappable_­v<Types> && ...) is true.
  • For the second overload, (is_­swappable_­v<const Types> && ...) is true.
Preconditions: Each element in *this is swappable with ([swappable.requirements]) the corresponding element in rhs.
Effects: Calls swap for each element in *this and its corresponding element in rhs.
Throws: Nothing unless one of the element-wise swap calls throws an exception.
Remarks: The exception specification is equivalent to
  • (is_­nothrow_­swappable_­v<Types> && ...) for the first overload and
  • (is_­nothrow_­swappable_­v<const Types> && ...) for the second overload.