22 General utilities library [utilities]

22.5 Optional objects [optional]

22.5.4 Partial specialization of optional for reference types [optional.optional.ref]

22.5.4.3 Assignment [optional.ref.assign]

constexpr optional& operator=(nullopt_t) noexcept;
Effects: Assigns nullptr to val.
Postconditions: *this does not contain a value.
Returns: *this.
template<class U> constexpr T& emplace(U&& u) noexcept(is_nothrow_constructible_v<T&, U>);
Constraints:
  • is_constructible_v<T&, U> is true, and
  • reference_constructs_from_temporary_v<T&, U> is false.
Effects: Equivalent to: convert-ref-init-val(std​::​forward<U>(u)).