22 General utilities library [utilities]

22.4 Tuples [tuple]

22.4.4 Class template tuple [tuple.tuple] swap [tuple.swap]

constexpr void swap(tuple& rhs) noexcept(see below); constexpr void swap(const tuple& rhs) const noexcept(see below);
  • 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.