Greater‐than operators

Synopses

Declared in <beman/optional/optional.hpp>

Orders two optionals with greater‐than.

template<
    typename T,
    typename U>
constexpr
bool
operator>(
    optional<T> const& lhs,
    optional<U> const& rhs)
requires detail::optional_gt_rel<T, U>;

Orders an optional after a value with greater‐than.

template<
    typename T,
    typename U>
constexpr
bool
operator>(
    optional<T> const& lhs,
    U const& rhs)
requires (!detail::is_optional<U>) && detail::optional_gt_rel<T, U>;

Orders a value after an optional with greater‐than.

template<
    typename T,
    typename U>
constexpr
bool
operator>(
    T const& lhs,
    optional<U> const& rhs)
requires (!detail::is_optional<T>) && detail::optional_gt_rel<T, U>;

Return Value

  • true if lhs orders after rhs.

  • true if lhs is engaged and its contained value orders after rhs.

  • true if rhs is disengaged, or lhs orders after its contained value.

Parameters

Name

Description

lhs

The left‐hand optional.

rhs

The right‐hand optional.

Created with MrDocs