24#ifndef MYSQL_SETS_COMMON_PREDICATES_H
25#define MYSQL_SETS_COMMON_PREDICATES_H
45template <Is_set Set1_t, Is_set Set2_t>
46 requires Is_compatible_set<Set1_t, Set2_t> && Is_iterator_defined_set<Set1_t>
47[[nodiscard]]
constexpr bool operator==(
const Set1_t &set1,
49 if constexpr (std::same_as<Set1_t, Set2_t>) {
51 if (&set1 == &set2)
return true;
57 auto size1 = set1.size();
58 auto size2 = set2.size();
59 if (size1 != size2)
return false;
61 auto it2 = set2.begin();
62 for (
auto &&value1 : set1) {
63 if (value1 != *it2)
return false;
64 assert(it2 != set2.end());
71 auto it2 = set2.begin();
72 for (
auto &&value1 : set1) {
73 if (it2 == set2.end())
return false;
74 if (value1 != *it2)
return false;
77 if (it2 != set2.end())
return false;
83template <Is_set Set1_t, Is_set Set2_t>
84 requires Is_compatible_set<Set1_t, Set2_t>
85[[nodiscard]]
constexpr bool operator!=(
const Set1_t &set1,
87 return !(set1 == set2);
99template <Is_set Set1_t, Is_set Set2_t>
100 requires Is_compatible_set<Set1_t, Set2_t>
101[[nodiscard]]
constexpr bool is_equal(
const Set1_t &set1,
const Set2_t &set2) {
110[[nodiscard]]
constexpr bool is_superset(
const auto &lhs,
const auto &rhs) {
119[[nodiscard]]
constexpr bool is_disjoint(
const auto &lhs,
const auto &rhs) {
Determines if the given type has "fast" size computations.
Definition: meta.h:61
Definition: gtid_set.h:183
constexpr bool is_subset(const Interval< Set_traits_t > &interval1, const Is_boundary_set_over_traits< Set_traits_t > auto &set2)
Return true if the left Interval is a subset of or equal to the right Boundary_set.
Definition: boundary_set_predicates.h:58
constexpr bool is_equal(const Set1_t &set1, const Set2_t &set2)
Return true if the two sets are equal, which must be of the same Set category and Set traits.
Definition: common_predicates.h:101
constexpr bool operator==(const Set1_t &set1, const Set2_t &set2)
Return true if two sets are equal, which must be of the same Set category and Set traits and be itera...
Definition: common_predicates.h:47
constexpr bool is_disjoint(const auto &lhs, const auto &rhs)
Return true if the two objects are disjoint (have nothing in common).
Definition: common_predicates.h:119
constexpr bool is_intersecting(const Interval< Set_traits_t > &interval, const Is_boundary_set_over_traits< Set_traits_t > auto &set)
Return true if the left Interval and the right Boundary set intersect (overlap).
Definition: boundary_set_predicates.h:121
constexpr bool is_superset(const auto &lhs, const auto &rhs)
Return true if the left object is a superset of or equal to the right object.
Definition: common_predicates.h:110
constexpr bool operator!=(const Set1_t &set1, const Set2_t &set2)
Return true if the two sets are not equal.
Definition: common_predicates.h:85