mrdocs::Optional::operator=

Assign from another Optional rvalue with convertible contained value.

Synopsis

Declared in <mrdocs/ADT/Optional.hpp>

template<typename U>
requires (!std::is_same_v<T, U>)
            && std::is_constructible_v<T, U>
            && std::is_assignable_v<T&, U>
            && (!detail::ConvertsFromOptional<T, U>::value)
            && (!detail::AssignsFromOptional<T, U>::value)
constexpr
Optional&
operator=(Optional<U>&& u) noexcept(/* see-below */);

Exception specification

This function is potentially-throwing unless std::is_nothrow_constructible_v<T, U> && std::is_nothrow_assignable_v<T &, U>.

Return Value

Reference to the current object

Parameters

Name

Description

u

Source optional.

Created with MrDocs