beman::optional::operator<=

Less-than-or-equal operators

Synopses

Declared in <beman/optional/optional.hpp>

Orders two optionals with less-than-or-equal.

template<
    typename T,
    typename U>
constexpr
bool
operator<=(
    optional<T> const& lhs,
    optional<U> const& rhs)
requires detail::optional_le_rel<T, U>;
» more...

Orders an optional before or equal to a value.

template<
    typename T,
    typename U>
constexpr
bool
operator<=(
    optional<T> const& lhs,
    U const& rhs)
requires (!detail::is_optional<U>) && detail::optional_le_rel<T, U>;
» more...

Orders a value before or equal to an optional.

template<
    typename T,
    typename U>
constexpr
bool
operator<=(
    T const& lhs,
    optional<U> const& rhs)
requires (!detail::is_optional<T>) && detail::optional_le_rel<T, U>;
» more...

Return Value

  • true if lhs does not order after rhs.
  • true if lhs is disengaged, or its contained value does not order after rhs.
  • true if rhs is engaged and lhs does not order after its contained value.

Parameters

NameDescription
lhsThe left-hand optional.
rhsThe right-hand optional.