.. _weakly_equality_comparable_with: ************************************* meta::weakly_equality_comparable_with ************************************* Defined in header ````. .. code-block:: cpp template concept weakly_equality_comparable_with = requires(std::remove_reference_t const& t, std::remove_reference_t const& u) { { t == u } -> meta::boolean; { t != u } -> meta::boolean; { u == t } -> meta::boolean; { u != t } -> meta::boolean; }; Pre-C++20 implementation of the *exposition-only* `weakly-equality-comparable-with `__ concept. ---- Concept emulation ================= .. code-block:: cpp namespace mgs { namespace meta { template struct is_weakly_equality_comparable_with { /* ... */ }; template constexpr auto is_weakly_equality_comparable_with_v = is_weakly_equality_comparable_with::value; template >> using weakly_equality_comparable_with = T; } // namespace meta } // namespace mgs Example ======= .. code-block:: cpp #include struct A {}; struct B {}; bool operator==(A, A); bool operator!=(A, A); bool operator==(B, B); bool operator!=(B, B); bool operator==(A, B); bool operator==(B, A); bool operator!=(A, B); bool operator!=(B, A); static_assert(is_weakly_equality_comparable_with_v, ""); static_assert(is_weakly_equality_comparable_with_v, ""); static_assert(!is_equality_comparable_with_v, ""); See also ======== * :ref:`boolean`