#
For each tuple assignment operator, an exception is thrown only if the assignment of one of the types in Types throws an exception.
In the function descriptions that follow, let i be in the range [0, sizeof.(Types)) in order,
constexpr tuple& operator=(const tuple& u);
Effects: Assigns each element of u to the corresponding element of *this.
Remarks: This operator is defined as deleted unless is_copy_assignable_v<
constexpr const tuple& operator=(const tuple& u) const;
Returns: *this.
constexpr tuple& operator=(tuple&& u) noexcept(see below);
Effects: For all i, assigns std​::​forward<
Remarks: The exception specification is equivalent to the logical and of the following expressions: is_nothrow_move_assignable_v<
constexpr const tuple& operator=(tuple&& u) const;
Effects: For all i, assigns std​::​forward<T
Returns: *this.
template<class. UTypes> constexpr tuple& operator=(const tuple<UTypes..>& u);
Effects: Assigns each element of u to the corresponding element of *this.
Returns: *this.
template<class. UTypes> constexpr const tuple& operator=(const tuple<UTypes..>& u) const;
Returns: *this.
template<class. UTypes> constexpr tuple& operator=(tuple<UTypes..>& u);
Effects: For all i, assigns std​::​forward<
Returns: *this.
template<class. UTypes> constexpr const tuple& operator=(tuple<UTypes..>& u) const;
Effects: For all i, assigns std​::​forward<U
Returns: *this.
template<class U1, class U2> constexpr tuple& operator=(const pair<U1, U2>& u);
Effects: Assigns u.first to the first element of *this and u.second to the second element of *this.
Returns: *this.
template<class U1, class U2> constexpr const tuple& operator=(const pair<U1, U2>& u) const;
Effects: Assigns u.first to the first element and u.second to the second element.
Returns: *this.
template<class U1, class U2> constexpr tuple& operator=(pair<U1, U2>& u);
Effects: Assigns std​::​forward<U1>(u.first) to the first element of *this and
std​::​forward<U2>(u.second) to the second element of *this.
Returns: *this.
template<class U1, class U2> constexpr const tuple& operator=(pair<U1, U2>& u) const;
Returns: *this.
template<tuple-like UTuple> constexpr tuple& operator=(UTuple&& u);
Constraints:
  • different-from<UTuple, tuple> ([range.utility.helpers]) is true,
  • remove_cvref_t<UTuple> is not a specialization of ranges​::​subrange,
  • sizeof.(Types) equals tuple_size_v<remove_cvref_t<UTuple>>, and
  • is_assignable_v<
Effects: For all i, assigns get<i>(std​::​forward<UTuple>(u)) to get<i>(*this).
Returns: *this.
template<tuple-like UTuple> constexpr const tuple& operator=(UTuple&& u) const;
Constraints:
  • different-from<UTuple, tuple> ([range.utility.helpers]) is true,
  • remove_cvref_t<UTuple> is not a specialization of ranges​::​subrange,
  • sizeof.(Types) equals tuple_size_v<remove_cvref_t<UTuple>>, and
  • is_assignable_v<const
Effects: For all i, assigns get<i>(std​::​forward<UTuple>(u)) to get<i>(*this).
Returns: *this.

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant