mrdocs::Optional::operator=

Assign from another Optional 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, const U&>
            && std::is_assignable_v<T&, const U&>
            && (!detail::ConvertsFromOptional<T, U>::value)
            && (!detail::AssignsFromOptional<T, U>::value)
constexpr
Optional&
operator=(Optional<U> const& u) noexcept(/* see-below */);

Exception specification

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

Return Value

Reference to the current object

Parameters

Name

Description

u

Source optional.

Created with MrDocs