Return whether the left‐hand operand is ordered before the right.

Synopsis

Declared in <bslstl_optional.h>

template<
    class t_LHS_TYPE,
    class t_RHS_TYPE>
constexpr
bool
operator<(
    bsl::optional<t_LHS_TYPE> const& lhs,
    std::optional<t_RHS_TYPE> const& rhs);

Description

Return true if the specified lhs optional object is ordered before the specified rhs optional object, and false otherwise. lhs is ordered before rhs if lhs is disengaged and rhs is engaged or if both are engaged and lhs.value() is ordered before rhs.value(). Note that this function will fail to compile if t_LHS_TYPE and t_RHS_TYPE are not compatible. These functions can be called in constant expressions only if the bsl::optional's value type is not allocator‐aware.

Return Value

true if lhs is ordered before rhs, and false otherwise

Parameters

Name

Description

lhs

left‐hand operand

rhs

right‐hand operand

Created with MrDocs