Files
2025-10-25 03:02:53 +03:00

1.5 KiB
Raw Permalink Blame History

[optional.ref.assign]

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;

1

#

Effects: Assigns nullptr to val.

2

#

Postconditions: *this does not contain a value.

3

#

Returns: *this.

🔗

template<class U> constexpr T& emplace(U&& u) noexcept(is_nothrow_constructible_v<T&, U>);

4

#

Constraints:

is_constructible_v<T&, U> is true, and

reference_constructs_from_temporary_v<T&, U> is false.

5

#

Effects: Equivalent to: convert-ref-init-val(std::forward(u)).