Function operator==

Summary

#include <include/type_safe/boolean.hpp>

(1) constexpr TYPE_SAFE_FORCE_INLINE bool operator==(const boolean &a, const boolean &b) noexcept

(2) template <typename T, typename = detail::enable_boolean<T>>
    constexpr TYPE_SAFE_FORCE_INLINE bool operator==(const boolean &a, T b) noexcept

(3) template <typename T, typename = detail::enable_boolean<T>>
    constexpr TYPE_SAFE_FORCE_INLINE bool operator==(T a, const boolean &b) noexcept

#include <include/type_safe/flag.hpp>

(4) template <typename T, typename = detail::enable_boolean<T>>
    constexpr bool operator==(flag lhs, T rhs) noexcept

(5) constexpr bool operator==(flag lhs, flag rhs) noexcept

(6) template <typename T, typename = detail::enable_boolean<T>>
    constexpr bool operator==(T lhs, flag rhs) noexcept

#include <include/type_safe/flag_set.hpp>

(7) template <typename Enum>
    constexpr bool operator==(const flag_set< Enum > &a, const flag_set< Enum > &b) noexcept

(8) template <typename Enum>
    constexpr bool operator==(const flag_set< Enum > &a, noflag_t b) noexcept

(9) template <typename Enum>
    constexpr bool operator==(noflag_t a, const flag_set< Enum > &b) noexcept

(10) template <typename Enum, typename FlagCombo, typename = detail::enable_flag_combo<FlagCombo, Enum>>
     constexpr bool operator==(const flag_set< Enum > &a, const FlagCombo &b) noexcept

(11) template <typename Enum, typename FlagCombo, typename = detail::enable_flag_combo<FlagCombo, Enum>>
     constexpr bool operator==(const FlagCombo &a, const flag_set< Enum > &b) noexcept

#include <include/type_safe/integer.hpp>

(12) template <typename A, typename B, class Policy, typename = detail::enable_safe_integer_comparison<A, B>>
     constexpr TYPE_SAFE_FORCE_INLINE bool operator==(const integer< A, Policy > &a, const integer< B, Policy > &b)

#include <include/type_safe/reference.hpp>

(13) template <typename T, typename U, bool XValue, typename = decltype(std::declval<T*>() == std::declval<U*>())>
     constexpr bool operator==(const object_ref< T, XValue > &a, const object_ref< U, XValue > &b) noexcept

(14) template <typename T, typename U, bool XValue, typename = decltype(std::declval<T*>() == std::declval<U*>())>
     constexpr bool operator==(const object_ref< T, XValue > &a, U &b) noexcept

(15) template <typename T, typename U, bool XValue, typename = decltype(std::declval<T*>() == std::declval<U*>())>
     constexpr bool operator==(const T &a, const object_ref< U, XValue > &b) noexcept

#include <include/type_safe/variant.hpp>

(16) lhs rhs rhs !lhs true !rhs typename T bool operator==(const basic_variant< VariantPolicy, Head, Types... > &lhs, const T &rhs)

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

(18) 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/boolean.hpp>

constexpr TYPE_SAFE_FORCE_INLINE bool operator==(const boolean &a, const boolean &b) noexcept

Description

[ts::boolean]() equality comparison.

Returns
true if (1) both [ts::boolean]() objects have the same value, (2)/(3) the boolean has the same value as the given value, false otherwise. \notes (2)/(3) do not participate in overload resolution if T is not a boolean type. \group boolean_comp_equal \module types

Source

Lines 90-93 in include/type_safe/boolean.hpp.

TYPE_SAFE_FORCE_INLINE constexpr bool operator==(const boolean& a, const boolean& b) noexcept
{
    return static_cast<bool>(a) == static_cast<bool>(b);
}

Synopsis

#include <include/type_safe/boolean.hpp>

template <typename T, typename = detail::enable_boolean<T>>
constexpr TYPE_SAFE_FORCE_INLINE bool operator==(const boolean &a, T b) noexcept

Description

\group boolean_comp_equal

Parameters

1 - \exclude

Source

Lines 98-102 in include/type_safe/boolean.hpp.

template <typename T, typename = detail::enable_boolean<T>>
TYPE_SAFE_FORCE_INLINE constexpr bool operator==(const boolean& a, T b) noexcept
{
    return static_cast<bool>(a) == static_cast<bool>(b);
}

Synopsis

#include <include/type_safe/boolean.hpp>

template <typename T, typename = detail::enable_boolean<T>>
constexpr TYPE_SAFE_FORCE_INLINE bool operator==(T a, const boolean &b) noexcept

Description

\group boolean_comp_equal

Parameters

1 - \exclude

Source

Lines 107-111 in include/type_safe/boolean.hpp.

template <typename T, typename = detail::enable_boolean<T>>
TYPE_SAFE_FORCE_INLINE constexpr bool operator==(T a, const boolean& b) noexcept
{
    return static_cast<bool>(a) == static_cast<bool>(b);
}

Synopsis

#include <include/type_safe/flag.hpp>

template <typename T, typename = detail::enable_boolean<T>>
constexpr bool operator==(flag lhs, T rhs) noexcept

Description

\exclude

\group flag_equal

Parameters

1 - \exclude

Source

Lines 141-145 in include/type_safe/flag.hpp. Line 17 in include/type_safe/flag.hpp.

template <typename T, typename>
constexpr bool operator==(flag lhs, T rhs) noexcept
{
    return lhs.state_ == static_cast<bool>(rhs);
}

Synopsis

#include <include/type_safe/flag.hpp>

constexpr bool operator==(flag lhs, flag rhs) noexcept

Description

[ts::flag]() equality comparison.

Returns
true if (1) both [ts::flag]() objects are in the same state, (2)/(3) the flag is in the given state. \notes (2)/(3) do not participate in overload resolution unless T is a boolean type. \group flag_equal \module types

Source

Lines 133-136 in include/type_safe/flag.hpp.

constexpr bool operator==(flag lhs, flag rhs) noexcept
{
    return lhs.state_ == rhs.state_;
}

Synopsis

#include <include/type_safe/flag.hpp>

template <typename T, typename = detail::enable_boolean<T>>
constexpr bool operator==(T lhs, flag rhs) noexcept

Description

\group flag_equal

Parameters

1 - \exclude

Source

Lines 150-154 in include/type_safe/flag.hpp.

template <typename T, typename = detail::enable_boolean<T>>
constexpr bool operator==(T lhs, flag rhs) noexcept
{
    return rhs == lhs;
}

Synopsis

#include <include/type_safe/flag_set.hpp>

template <typename Enum>
constexpr bool operator==(const flag_set< Enum > &a, const flag_set< Enum > &b) noexcept

Description

flag_set equality comparison.

Returns
Whether both flag sets have the same combination of flags set/not set. \group flag_set_equal flag_set equality comparison

Source

Lines 632-636 in include/type_safe/flag_set.hpp.

template <typename Enum>
constexpr bool operator==(const flag_set<Enum>& a, const flag_set<Enum>& b) noexcept
{
    return combo(a) == combo(b);
}

Synopsis

#include <include/type_safe/flag_set.hpp>

template <typename Enum>
constexpr bool operator==(const flag_set< Enum > &a, noflag_t b) noexcept

Description

\group flag_set_equal

Source

Lines 639-643 in include/type_safe/flag_set.hpp.

template <typename Enum>
constexpr bool operator==(const flag_set<Enum>& a, noflag_t b) noexcept
{
    return combo(a) == b;
}

Synopsis

#include <include/type_safe/flag_set.hpp>

template <typename Enum>
constexpr bool operator==(noflag_t a, const flag_set< Enum > &b) noexcept

Description

\group flag_set_equal

Source

Lines 646-650 in include/type_safe/flag_set.hpp.

template <typename Enum>
constexpr bool operator==(noflag_t a, const flag_set<Enum>& b) noexcept
{
    return a == combo(b);
}

Synopsis

#include <include/type_safe/flag_set.hpp>

template <typename Enum, typename FlagCombo, typename = detail::enable_flag_combo<FlagCombo, Enum>>
constexpr bool operator==(const flag_set< Enum > &a, const FlagCombo &b) noexcept

Description

\group flag_set_equal

Source

Lines 653-657 in include/type_safe/flag_set.hpp.

template <typename Enum, typename FlagCombo, typename = detail::enable_flag_combo<FlagCombo, Enum>>
constexpr bool operator==(const flag_set<Enum>& a, const FlagCombo& b) noexcept
{
    return combo(a) == b;
}

Synopsis

#include <include/type_safe/flag_set.hpp>

template <typename Enum, typename FlagCombo, typename = detail::enable_flag_combo<FlagCombo, Enum>>
constexpr bool operator==(const FlagCombo &a, const flag_set< Enum > &b) noexcept

Description

\group flag_set_equal

Source

Lines 660-664 in include/type_safe/flag_set.hpp.

template <typename Enum, typename FlagCombo, typename = detail::enable_flag_combo<FlagCombo, Enum>>
constexpr bool operator==(const FlagCombo& a, const flag_set<Enum>& b) noexcept
{
    return a == combo(b);
}

Synopsis

#include <include/type_safe/integer.hpp>

template <typename A, typename B, class Policy, typename = detail::enable_safe_integer_comparison<A, B>>
constexpr TYPE_SAFE_FORCE_INLINE bool operator==(const integer< A, Policy > &a, const integer< B, Policy > &b)

Description

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

3 - \exclude

Source

Lines 494-498 in include/type_safe/integer.hpp.

/// \group int_comp Comparison operators
/// \module types
/// \param 3
/// \exclude
template <typename A, typename B, class Policy,

Synopsis

#include <include/type_safe/reference.hpp>

template <typename T, typename U, bool XValue, typename = decltype(std::declval<T*>() == std::declval<U*>())>
constexpr bool operator==(const object_ref< T, XValue > &a, const object_ref< U, XValue > &b) noexcept

Description

Comparison operator for [ts::object_ref]().

Two references are equal if both refer to the same object. A reference is equal to an object if the reference refers to that object. \notes These functions do not participate in overload resolution if the types are not compatible (i.e. const/non-const or derived). \group ref_compare Object reference comparison

Parameters

3 - \exclude

Source

Lines 161-166 in include/type_safe/reference.hpp.

template <typename T, typename U, bool XValue,
          typename = decltype(std::declval<T*>() == std::declval<U*>())>
constexpr bool operator==(const object_ref<T, XValue>& a, const object_ref<U, XValue>& b) noexcept
{
    return a.operator->() == b.operator->();
}

Synopsis

#include <include/type_safe/reference.hpp>

template <typename T, typename U, bool XValue, typename = decltype(std::declval<T*>() == std::declval<U*>())>
constexpr bool operator==(const object_ref< T, XValue > &a, U &b) noexcept

Description

\group ref_compare

Parameters

3 - \exclude

Source

Lines 171-176 in include/type_safe/reference.hpp.

template <typename T, typename U, bool XValue,
          typename = decltype(std::declval<T*>() == std::declval<U*>())>
constexpr bool operator==(const object_ref<T, XValue>& a, U& b) noexcept
{
    return a.operator->() == &b;
}

Synopsis

#include <include/type_safe/reference.hpp>

template <typename T, typename U, bool XValue, typename = decltype(std::declval<T*>() == std::declval<U*>())>
constexpr bool operator==(const T &a, const object_ref< U, XValue > &b) noexcept

Description

\group ref_compare

Parameters

3 - \exclude

Source

Lines 181-186 in include/type_safe/reference.hpp.

template <typename T, typename U, bool XValue,
          typename = decltype(std::declval<T*>() == std::declval<U*>())>
constexpr bool operator==(const T& a, const object_ref<U, XValue>& b) noexcept
{
    return &a == b.operator->();
}

Synopsis

#include <include/type_safe/variant.hpp>

lhs rhs rhs !lhs true !rhs typename T bool operator==(const basic_variant< VariantPolicy, Head, Types... > &lhs, const T &rhs)

Description

No description yet.

Source

Lines 572-576 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)
{
    return lhs.has_value(variant_type<T>{}) && 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 578-582 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)
{
    return rhs == lhs;
}

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

Compares two [ts::basic_variant]()s.

They compare equal if both store the same type (or none) and the stored object compares equal. A variant is less than another if they store mismatched types and the type id of the first is less than the other, or if they store the same type and the stored object compares less. The other comparisons behave accordingly. \module variant \group variant_comp

Source

Lines 663-669 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_equal(lhs, rhs);
}





Add Discussion as Guest

Log in