Function operator<

Summary

#include <include/type_safe/floating_point.hpp>

(1) template <typename A, typename B, typename = detail::enable_safe_floating_point_comparison<A, B>>
    constexpr TYPE_SAFE_FORCE_INLINE bool operator<(const floating_point< A > &a, const floating_point< B > &b) noexcept

#include <include/type_safe/variant.hpp>

(2) template <class VariantPolicy, typename Head, typename... Types, typename T>
    bool operator<(const basic_variant< VariantPolicy, Head, Types... > &lhs, const T &rhs)

(3) template <class VariantPolicy, typename Head, typename... Types, typename T>
    bool operator<(const T &lhs, const basic_variant< VariantPolicy, Head, Types... > &rhs)

(4) template <class VariantPolicy, typename Head, typename... Types>
    bool operator<(const basic_variant< VariantPolicy, Head, Types... > &lhs, const basic_variant< VariantPolicy, Head, Types... > &rhs)

Function overload

Synopsis

#include <include/type_safe/floating_point.hpp>

template <typename A, typename B, typename = detail::enable_safe_floating_point_comparison<A, B>>
constexpr TYPE_SAFE_FORCE_INLINE bool operator<(const floating_point< A > &a, const floating_point< B > &b) noexcept

Description

Returns
The result of the comparison of the stored floating point value in the [ts::floating_point](). \notes These functions do not participate in overload resolution unless A and B are both floating point types. \group float_comp Comparison operators \module types
Parameters

2 - \exclude

Source

Lines 294-301 in include/type_safe/floating_point.hpp.

/** \exclude */                                                                                \
template <typename A, typename B,                                                              \
          typename = detail::fallback_safe_floating_point_comparison<A, B>>                    \
constexpr bool operator Op(floating_point<A>, B) = delete;
\returns The result of the comparison of the stored floating point value in the
[ts::floating_point](). \notes These functions do not participate in overload resolution unless
`A` and `B` are both floating point types. \group float_comp Comparison operators \module types

Synopsis

#include <include/type_safe/variant.hpp>

template <class VariantPolicy, typename Head, typename... Types, typename T>
bool operator<(const basic_variant< VariantPolicy, Head, Types... > &lhs, const T &rhs)

Description

\group variant_comp_t

Source

Lines 598-606 in include/type_safe/variant.hpp.

template <class VariantPolicy, typename Head, typename... Types, typename T>
bool operator<(const basic_variant<VariantPolicy, Head, Types...>& lhs, const T& rhs)
{
    constexpr auto id =
        typename basic_variant<VariantPolicy, Head, Types...>::type_id(variant_type<T>{});
    if (lhs.type() != id)
        return lhs.type() < id;
    return lhs.value(variant_type<T>{}) < rhs;
}

Synopsis

#include <include/type_safe/variant.hpp>

template <class VariantPolicy, typename Head, typename... Types, typename T>
bool operator<(const T &lhs, const basic_variant< VariantPolicy, Head, Types... > &rhs)

Description

\group variant_comp_t

Source

Lines 608-616 in include/type_safe/variant.hpp.

template <class VariantPolicy, typename Head, typename... Types, typename T>
bool operator<(const T& lhs, const basic_variant<VariantPolicy, Head, Types...>& rhs)
{
    constexpr auto id =
        typename basic_variant<VariantPolicy, Head, Types...>::type_id(variant_type<T>{});
    if (id != rhs.type())
        return id < rhs.type();
    return lhs < rhs.value(variant_type<T>{});
}

Synopsis

#include <include/type_safe/variant.hpp>

template <class VariantPolicy, typename Head, typename... Types>
bool operator<(const basic_variant< VariantPolicy, Head, Types... > &lhs, const basic_variant< VariantPolicy, Head, Types... > &rhs)

Description

\group variant_comp

Source

Lines 680-686 in include/type_safe/variant.hpp.

template <class VariantPolicy, typename Head, typename... Types>
bool operator<(const basic_variant<VariantPolicy, Head, Types...>& lhs,
               const basic_variant<VariantPolicy, Head, Types...>& rhs)
{
    return detail::compare_variant<basic_variant<VariantPolicy, Head, Types...>>::compare_less(lhs,
                                                                                               rhs);
}





Add Discussion as Guest

Log in