24#ifndef MYSQL_SETS_BOUNDARY_SET_BINARY_OPERATION_ITERATOR_H
25#define MYSQL_SETS_BOUNDARY_SET_BINARY_OPERATION_ITERATOR_H
44template <Is_boundary_set Source1_tp, Is_boundary_set Source2_tp,
46 requires Is_compatible_set<Source1_tp, Source2_tp>
49 Boundary_set_binary_operation_iterator<Source1_tp, Source2_tp,
252 using Less_t =
typename Set_traits_t::Less_t;
311 return m_pos1.is_endpoint();
313 return !
m_pos2.is_endpoint();
320 return m_pos1.is_endpoint();
322 return m_pos2.is_endpoint();
420 const auto &source_b,
422 assert(source_a.has_object());
424 assert(pos_a != source_a->end());
426 if (pos_b == source_b.end()) {
427 pos_a = source_a->end();
431 pos_a = source_a->lower_bound(pos_a, *pos_b);
465 return !pos_b_is_endpoint;
469 return pos_b_is_endpoint;
475 return pos_b_is_endpoint == (
m_order > 0);
483 return Set_traits_t::lt(element1, element2);
CRTP base class (mixin) that makes your class a standard-compliant iterator, given only a minimal set...
Definition: iterator_interface.h:370
auto end() const
Return a valid end iterator, even if !has_object().
Definition: view_sources.h:273
Forward iterator over the result of a binary set operation (union, intersection, or subtraction) over...
Definition: boundary_set_binary_operation_iterator.h:50
constexpr bool is_output_boundary()
Assuming both iterators point to the same value, or both point to the end, return true if that positi...
Definition: boundary_set_binary_operation_iterator.h:439
static constexpr bool lt(const Element_t &element1, const Element_t &element2)
Definition: boundary_set_binary_operation_iterator.h:481
Iterator1_t m_pos1
Iterator to current position in m_source1.
Definition: boundary_set_binary_operation_iterator.h:493
bool advance_if_not_output_boundary(const auto &source_a, auto &pos_a, const auto &source_b, auto &pos_b)
Assuming the iterators point to different values where pos_a < pos_b: if pos_a is not at an output bo...
Definition: boundary_set_binary_operation_iterator.h:418
static constexpr auto operation
Definition: boundary_set_binary_operation_iterator.h:249
typename Set_traits_t::Less_t Less_t
Definition: boundary_set_binary_operation_iterator.h:252
mysql::ranges::Range_const_iterator_type< Source1_t > Iterator1_t
Definition: boundary_set_binary_operation_iterator.h:255
Opt_source2_t m_source2
Pointer to the right-hand-side source.
Definition: boundary_set_binary_operation_iterator.h:490
void compute_order()
Set m_order to -1, 0, or 1, according to the relative order of m_pos1 and m_pos2.
Definition: boundary_set_binary_operation_iterator.h:347
constexpr bool is_output_boundary(bool pos_b_is_endpoint)
Assuming the iterators point to different values, return true if the smallest-valued iterator points ...
Definition: boundary_set_binary_operation_iterator.h:460
Boundary_set_binary_operation_iterator()=default
Source1_tp Source1_t
Definition: boundary_set_binary_operation_iterator.h:245
typename Set_traits_t::Element_t Element_t
Definition: boundary_set_binary_operation_iterator.h:251
bool is_endpoint() const
Definition: boundary_set_binary_operation_iterator.h:300
Source2_tp Source2_t
Definition: boundary_set_binary_operation_iterator.h:246
void next()
Move to the next iterator position.
Definition: boundary_set_binary_operation_iterator.h:327
Iterator2_t position2() const
Return the current iterator to the second source.
Definition: boundary_set_binary_operation_iterator.h:339
typename Source1_t::Set_traits_t Set_traits_t
Definition: boundary_set_binary_operation_iterator.h:250
bool is_equal(const This_t &other) const
Definition: boundary_set_binary_operation_iterator.h:292
mysql::ranges::Range_const_iterator_type< Source2_t > Iterator2_t
Definition: boundary_set_binary_operation_iterator.h:256
Opt_source1_t m_source1
Pointer to the left-hand-side source.
Definition: boundary_set_binary_operation_iterator.h:487
Element_t get() const
Definition: boundary_set_binary_operation_iterator.h:284
Boundary_set_binary_operation_iterator(Boundary_set_binary_operation_iterator &&) noexcept=default
int m_order
-1 if m_pos1 < m_pos2; 0 if m_pos1 == m_pos2; 1 if m_pos1 > m_pos2.
Definition: boundary_set_binary_operation_iterator.h:500
Iterator2_t m_pos2
Iterator to current position in m_source2.
Definition: boundary_set_binary_operation_iterator.h:496
void advance_to_boundary()
Until the pair of iterators defines an output boundary, advance the smallest-valued iterator past the...
Definition: boundary_set_binary_operation_iterator.h:367
Iterator1_t position1() const
Return the current iterator to the first source.
Definition: boundary_set_binary_operation_iterator.h:336
Boundary_set_binary_operation_iterator(const Boundary_set_binary_operation_iterator &source) noexcept=default
bool advance_if_not_output_boundary()
Assuming both iterators point to the same value: if they are not an output boundary,...
Definition: boundary_set_binary_operation_iterator.h:392
std::remove_cvref_t< decltype(std::declval< const Range_t >().begin())> Range_const_iterator_type
Gives the const_iterator type, deduced from the begin() const member.
Definition: meta.h:47
Binary_operation
Identifies the type of a binary operation.
Definition: binary_operation.h:37
noexcept
The return type for any call_and_catch(f, args...) call where f(args...) returns Type.
Definition: call_and_catch.h:76
repeated Source source
Definition: replication_asynchronous_connection_failover.proto:42