MySQL 9.6.0
Source Code Documentation
mysql::sets::Upper_lower_bound_interface< Self_tp, Set_traits_tp, Iterator_tp, Const_iterator_tp, Iterator_getter_tp > Class Template Reference

CRTP base class (mixin) to define a set that has upper_bound and lower_bound members. More...

#include <upper_lower_bound_interface.h>

Public Types

using Iterator_t = Iterator_tp
 
using Const_iterator_t = Const_iterator_tp
 
using Set_traits_t = Set_traits_tp
 
using Iterator_getter_t = Iterator_getter_tp
 
using Element_t = typename Set_traits_t::Element_t
 

Public Member Functions

constexpr Iterator_t lower_bound (const Iterator_t &hint, const Element_t &element)
 Return the lower bound for element, using an iterator hint known to be less than or equal to the correct result. More...
 
constexpr Const_iterator_t lower_bound (const Const_iterator_t &hint, const Element_t &element) const
 Return the lower bound for element, using an iterator hint known to be less than or equal to the correct result. More...
 
constexpr Iterator_t lower_bound (const Element_t &element)
 Return the lower bound for element. More...
 
constexpr Const_iterator_t lower_bound (const Element_t &element) const
 Return the lower bound for element. More...
 
constexpr Iterator_t upper_bound (const Iterator_t &hint, const Element_t &element)
 Return the upper bound for element, using an iterator hint known to be less than or equal to the correct result. More...
 
constexpr Const_iterator_t upper_bound (const Const_iterator_t &hint, const Element_t &element) const
 Return the upper bound for element, using an iterator hint known to be less than or equal to the correct result. More...
 
constexpr Iterator_t upper_bound (const Element_t &element)
 Return the upper bound for element. More...
 
constexpr Const_iterator_t upper_bound (const Element_t &element) const
 Return the upper bound for element. More...
 

Static Public Member Functions

template<std::derived_from< Self_t > Self_arg_t, mysql::ranges::Is_iterator_for_range< Self_arg_t > Iter_t>
static constexpr Iter_t lower_bound_dispatch (Self_arg_t &self_arg, const Iter_t &hint, const Element_t &element)
 Implements the lower_bound functions with hint defined above, checking if the hint is already the correct answer, and otherwise delegating to the implementing class. More...
 
template<std::derived_from< Self_t > Self_arg_t>
static constexpr auto lower_bound_dispatch (Self_arg_t &self_arg, const Element_t &element)
 Implements the lower_bound functions without hint defined above. More...
 
template<std::derived_from< Self_t > Self_arg_t, mysql::ranges::Is_iterator_for_range< Self_arg_t > Iter_t>
static constexpr Iter_t upper_bound_dispatch (Self_arg_t &self_arg, const Iter_t &hint, const Element_t &element)
 Implements the upper_bound functions with hint defined above, checking if the hint is already the correct answer, and otherwise delegating to the implementing class. More...
 
template<std::derived_from< Self_t > Self_arg_t>
static constexpr auto upper_bound_dispatch (Self_arg_t &self_arg, const Element_t &element)
 Implements the upper_bound functions without hint defined above. More...
 

Private Types

using Self_t = Self_tp
 

Private Member Functions

constexpr const Self_tself () const
 CRTP helper to return a const reference to the subclass on which the function is invoked. More...
 
constexpr Self_tself ()
 CRTP helper to return a non-const reference to the subclass on which the function is invoked. More...
 

Detailed Description

template<class Self_tp, Is_ordered_set_traits Set_traits_tp, std::forward_iterator Iterator_tp, std::forward_iterator Const_iterator_tp, Is_getter_for_iterator< Iterator_tp > Iterator_getter_tp>
class mysql::sets::Upper_lower_bound_interface< Self_tp, Set_traits_tp, Iterator_tp, Const_iterator_tp, Iterator_getter_tp >

CRTP base class (mixin) to define a set that has upper_bound and lower_bound members.

Typically, the implementation defines two member functions: the static member functions upper_bound_impl and lower_bound_impl taking a hint, and this class provides all the other 12 functions.

The implementation needs to satisfy Is_upper_lower_bound_implementation. This class will provide const/non-const upper_bound/lower_bound member functions that take/don't take iterator hints.

It also provides static member functions upper_bound_dispatch/lower_bound_dispatch, which take either a const or a non-const instance in the first argument, and which take/don't take iterator hints.

Member Typedef Documentation

◆ Const_iterator_t

template<class Self_tp , Is_ordered_set_traits Set_traits_tp, std::forward_iterator Iterator_tp, std::forward_iterator Const_iterator_tp, Is_getter_for_iterator< Iterator_tp > Iterator_getter_tp>
using mysql::sets::Upper_lower_bound_interface< Self_tp, Set_traits_tp, Iterator_tp, Const_iterator_tp, Iterator_getter_tp >::Const_iterator_t = Const_iterator_tp

◆ Element_t

template<class Self_tp , Is_ordered_set_traits Set_traits_tp, std::forward_iterator Iterator_tp, std::forward_iterator Const_iterator_tp, Is_getter_for_iterator< Iterator_tp > Iterator_getter_tp>
using mysql::sets::Upper_lower_bound_interface< Self_tp, Set_traits_tp, Iterator_tp, Const_iterator_tp, Iterator_getter_tp >::Element_t = typename Set_traits_t::Element_t

◆ Iterator_getter_t

template<class Self_tp , Is_ordered_set_traits Set_traits_tp, std::forward_iterator Iterator_tp, std::forward_iterator Const_iterator_tp, Is_getter_for_iterator< Iterator_tp > Iterator_getter_tp>
using mysql::sets::Upper_lower_bound_interface< Self_tp, Set_traits_tp, Iterator_tp, Const_iterator_tp, Iterator_getter_tp >::Iterator_getter_t = Iterator_getter_tp

◆ Iterator_t

template<class Self_tp , Is_ordered_set_traits Set_traits_tp, std::forward_iterator Iterator_tp, std::forward_iterator Const_iterator_tp, Is_getter_for_iterator< Iterator_tp > Iterator_getter_tp>
using mysql::sets::Upper_lower_bound_interface< Self_tp, Set_traits_tp, Iterator_tp, Const_iterator_tp, Iterator_getter_tp >::Iterator_t = Iterator_tp

◆ Self_t

template<class Self_tp , Is_ordered_set_traits Set_traits_tp, std::forward_iterator Iterator_tp, std::forward_iterator Const_iterator_tp, Is_getter_for_iterator< Iterator_tp > Iterator_getter_tp>
using mysql::sets::Upper_lower_bound_interface< Self_tp, Set_traits_tp, Iterator_tp, Const_iterator_tp, Iterator_getter_tp >::Self_t = Self_tp
private

◆ Set_traits_t

template<class Self_tp , Is_ordered_set_traits Set_traits_tp, std::forward_iterator Iterator_tp, std::forward_iterator Const_iterator_tp, Is_getter_for_iterator< Iterator_tp > Iterator_getter_tp>
using mysql::sets::Upper_lower_bound_interface< Self_tp, Set_traits_tp, Iterator_tp, Const_iterator_tp, Iterator_getter_tp >::Set_traits_t = Set_traits_tp

Member Function Documentation

◆ lower_bound() [1/4]

template<class Self_tp , Is_ordered_set_traits Set_traits_tp, std::forward_iterator Iterator_tp, std::forward_iterator Const_iterator_tp, Is_getter_for_iterator< Iterator_tp > Iterator_getter_tp>
constexpr Const_iterator_t mysql::sets::Upper_lower_bound_interface< Self_tp, Set_traits_tp, Iterator_tp, Const_iterator_tp, Iterator_getter_tp >::lower_bound ( const Const_iterator_t hint,
const Element_t element 
) const
inlineconstexpr

Return the lower bound for element, using an iterator hint known to be less than or equal to the correct result.

This is the const version of the function.

The hint may allow for optimizations. If no hint is known, use the hint-less function instead.

Parameters
hintIterator hint. This must be less than or equal to the correct result.
elementValue to query.
Returns
Iterator to the first lower bound for element, i.e., the first element that is greater than or equal to element, or to the end if no such element exists.

◆ lower_bound() [2/4]

template<class Self_tp , Is_ordered_set_traits Set_traits_tp, std::forward_iterator Iterator_tp, std::forward_iterator Const_iterator_tp, Is_getter_for_iterator< Iterator_tp > Iterator_getter_tp>
constexpr Iterator_t mysql::sets::Upper_lower_bound_interface< Self_tp, Set_traits_tp, Iterator_tp, Const_iterator_tp, Iterator_getter_tp >::lower_bound ( const Element_t element)
inlineconstexpr

Return the lower bound for element.

This is the non-const version of the function.

Parameters
elementValue to query.
Returns
Iterator to the first lower bound for element, i.e., the first element that is greater than or equal to element, or to the end if no such element exists.

◆ lower_bound() [3/4]

template<class Self_tp , Is_ordered_set_traits Set_traits_tp, std::forward_iterator Iterator_tp, std::forward_iterator Const_iterator_tp, Is_getter_for_iterator< Iterator_tp > Iterator_getter_tp>
constexpr Const_iterator_t mysql::sets::Upper_lower_bound_interface< Self_tp, Set_traits_tp, Iterator_tp, Const_iterator_tp, Iterator_getter_tp >::lower_bound ( const Element_t element) const
inlineconstexpr

Return the lower bound for element.

This is the const version of the function.

Parameters
elementValue to query.
Returns
Iterator to the first lower bound for element, i.e., the first element that is greater than or equal to element, or to the end if no such element exists.

◆ lower_bound() [4/4]

template<class Self_tp , Is_ordered_set_traits Set_traits_tp, std::forward_iterator Iterator_tp, std::forward_iterator Const_iterator_tp, Is_getter_for_iterator< Iterator_tp > Iterator_getter_tp>
constexpr Iterator_t mysql::sets::Upper_lower_bound_interface< Self_tp, Set_traits_tp, Iterator_tp, Const_iterator_tp, Iterator_getter_tp >::lower_bound ( const Iterator_t hint,
const Element_t element 
)
inlineconstexpr

Return the lower bound for element, using an iterator hint known to be less than or equal to the correct result.

This is the non-const version of the function.

The hint may allow for optimizations. If no hint is known, use the hint-less function instead.

Parameters
hintIterator hint. This must be less than or equal to the correct result.
elementValue to query.
Returns
Iterator to the first lower bound for element, i.e., the first element that is greater than or equal to element, or to the end if no such element exists.

◆ lower_bound_dispatch() [1/2]

template<class Self_tp , Is_ordered_set_traits Set_traits_tp, std::forward_iterator Iterator_tp, std::forward_iterator Const_iterator_tp, Is_getter_for_iterator< Iterator_tp > Iterator_getter_tp>
template<std::derived_from< Self_t > Self_arg_t>
static constexpr auto mysql::sets::Upper_lower_bound_interface< Self_tp, Set_traits_tp, Iterator_tp, Const_iterator_tp, Iterator_getter_tp >::lower_bound_dispatch ( Self_arg_t &  self_arg,
const Element_t element 
)
inlinestaticconstexpr

Implements the lower_bound functions without hint defined above.

◆ lower_bound_dispatch() [2/2]

template<class Self_tp , Is_ordered_set_traits Set_traits_tp, std::forward_iterator Iterator_tp, std::forward_iterator Const_iterator_tp, Is_getter_for_iterator< Iterator_tp > Iterator_getter_tp>
template<std::derived_from< Self_t > Self_arg_t, mysql::ranges::Is_iterator_for_range< Self_arg_t > Iter_t>
static constexpr Iter_t mysql::sets::Upper_lower_bound_interface< Self_tp, Set_traits_tp, Iterator_tp, Const_iterator_tp, Iterator_getter_tp >::lower_bound_dispatch ( Self_arg_t &  self_arg,
const Iter_t &  hint,
const Element_t element 
)
inlinestaticconstexpr

Implements the lower_bound functions with hint defined above, checking if the hint is already the correct answer, and otherwise delegating to the implementing class.

◆ self() [1/2]

template<class Self_tp , Is_ordered_set_traits Set_traits_tp, std::forward_iterator Iterator_tp, std::forward_iterator Const_iterator_tp, Is_getter_for_iterator< Iterator_tp > Iterator_getter_tp>
constexpr Self_t & mysql::sets::Upper_lower_bound_interface< Self_tp, Set_traits_tp, Iterator_tp, Const_iterator_tp, Iterator_getter_tp >::self ( )
inlineconstexprprivate

CRTP helper to return a non-const reference to the subclass on which the function is invoked.

◆ self() [2/2]

template<class Self_tp , Is_ordered_set_traits Set_traits_tp, std::forward_iterator Iterator_tp, std::forward_iterator Const_iterator_tp, Is_getter_for_iterator< Iterator_tp > Iterator_getter_tp>
constexpr const Self_t & mysql::sets::Upper_lower_bound_interface< Self_tp, Set_traits_tp, Iterator_tp, Const_iterator_tp, Iterator_getter_tp >::self ( ) const
inlineconstexprprivate

CRTP helper to return a const reference to the subclass on which the function is invoked.

◆ upper_bound() [1/4]

template<class Self_tp , Is_ordered_set_traits Set_traits_tp, std::forward_iterator Iterator_tp, std::forward_iterator Const_iterator_tp, Is_getter_for_iterator< Iterator_tp > Iterator_getter_tp>
constexpr Const_iterator_t mysql::sets::Upper_lower_bound_interface< Self_tp, Set_traits_tp, Iterator_tp, Const_iterator_tp, Iterator_getter_tp >::upper_bound ( const Const_iterator_t hint,
const Element_t element 
) const
inlineconstexpr

Return the upper bound for element, using an iterator hint known to be less than or equal to the correct result.

This is the const version of the function.

The hint may allow for optimizations. If no hint is known, use the hint-less function instead.

Parameters
hintIterator hint. This must be less than or equal to the correct result.
elementValue to query.
Returns
Iterator to the first upper bound for element, i.e., the first element that is strictly greater than element, or to the end if no such element exists.

◆ upper_bound() [2/4]

template<class Self_tp , Is_ordered_set_traits Set_traits_tp, std::forward_iterator Iterator_tp, std::forward_iterator Const_iterator_tp, Is_getter_for_iterator< Iterator_tp > Iterator_getter_tp>
constexpr Iterator_t mysql::sets::Upper_lower_bound_interface< Self_tp, Set_traits_tp, Iterator_tp, Const_iterator_tp, Iterator_getter_tp >::upper_bound ( const Element_t element)
inlineconstexpr

Return the upper bound for element.

This is the non-const version of the function.

Parameters
elementValue to query.
Returns
Iterator to the first upper bound for element, i.e., the first element that is strictly greater than element, or to the end if no such element exists.

◆ upper_bound() [3/4]

template<class Self_tp , Is_ordered_set_traits Set_traits_tp, std::forward_iterator Iterator_tp, std::forward_iterator Const_iterator_tp, Is_getter_for_iterator< Iterator_tp > Iterator_getter_tp>
constexpr Const_iterator_t mysql::sets::Upper_lower_bound_interface< Self_tp, Set_traits_tp, Iterator_tp, Const_iterator_tp, Iterator_getter_tp >::upper_bound ( const Element_t element) const
inlineconstexpr

Return the upper bound for element.

This is the const version of the function.

Parameters
elementValue to query.
Returns
Iterator to the first upper bound for element, i.e., the first element that is strictly greater than element, or to the end if no such element exists.

◆ upper_bound() [4/4]

template<class Self_tp , Is_ordered_set_traits Set_traits_tp, std::forward_iterator Iterator_tp, std::forward_iterator Const_iterator_tp, Is_getter_for_iterator< Iterator_tp > Iterator_getter_tp>
constexpr Iterator_t mysql::sets::Upper_lower_bound_interface< Self_tp, Set_traits_tp, Iterator_tp, Const_iterator_tp, Iterator_getter_tp >::upper_bound ( const Iterator_t hint,
const Element_t element 
)
inlineconstexpr

Return the upper bound for element, using an iterator hint known to be less than or equal to the correct result.

This is the non-const version of the function.

The hint may allow for optimizations. If no hint is known, use the hint-less function instead.

Parameters
hintIterator hint. This must be less than or equal to the correct result.
elementValue to query.
Returns
Iterator to the first upper bound for element, i.e., the first element that is strictly greater than element, or to the end if no such element exists.

◆ upper_bound_dispatch() [1/2]

template<class Self_tp , Is_ordered_set_traits Set_traits_tp, std::forward_iterator Iterator_tp, std::forward_iterator Const_iterator_tp, Is_getter_for_iterator< Iterator_tp > Iterator_getter_tp>
template<std::derived_from< Self_t > Self_arg_t>
static constexpr auto mysql::sets::Upper_lower_bound_interface< Self_tp, Set_traits_tp, Iterator_tp, Const_iterator_tp, Iterator_getter_tp >::upper_bound_dispatch ( Self_arg_t &  self_arg,
const Element_t element 
)
inlinestaticconstexpr

Implements the upper_bound functions without hint defined above.

◆ upper_bound_dispatch() [2/2]

template<class Self_tp , Is_ordered_set_traits Set_traits_tp, std::forward_iterator Iterator_tp, std::forward_iterator Const_iterator_tp, Is_getter_for_iterator< Iterator_tp > Iterator_getter_tp>
template<std::derived_from< Self_t > Self_arg_t, mysql::ranges::Is_iterator_for_range< Self_arg_t > Iter_t>
static constexpr Iter_t mysql::sets::Upper_lower_bound_interface< Self_tp, Set_traits_tp, Iterator_tp, Const_iterator_tp, Iterator_getter_tp >::upper_bound_dispatch ( Self_arg_t &  self_arg,
const Iter_t &  hint,
const Element_t element 
)
inlinestaticconstexpr

Implements the upper_bound functions with hint defined above, checking if the hint is already the correct answer, and otherwise delegating to the implementing class.


The documentation for this class was generated from the following file: