24#ifndef MYSQL_UTILS_TUPLE_FIND_H
25#define MYSQL_UTILS_TUPLE_FIND_H
42template <
class Tuple,
template <
class>
class Pred, std::size_t
index = 0>
47template <
class Tuple,
template <
class>
class Pred, std::size_t
index>
48 requires(index < std::tuple_size_v<Tuple> &&
49 Pred<std::tuple_element_t<index, Tuple>>
::value)
51 :
public std::integral_constant<std::size_t, index> {};
55template <
class Tuple,
template <
class>
class Pred, std::size_t
index>
56 requires(index < std::tuple_size_v<Tuple> &&
57 !Pred<std::tuple_element_t<index, Tuple>>
::value)
65template <
class Tuple,
template <
class>
class Pred, std::size_t
index = 0>
69template <
class Tuple,
template <
class>
class Pred, std::size_t
index>
70 requires(index < std::tuple_size_v<Tuple>)
72 :
public std::integral_constant<
77 (Pred<std::tuple_element_t<index, Tuple>>::
value ? 1 : 0)> {};
85 template <
class Type2>
108template <
class Tuple,
template <
class>
class Pred>
131template <
class Tuple,
template <
class>
class Pred>
155template <
class Tuple,
template <
class>
class Pred>
174template <
template <
class>
class Pred,
class Tuple>
176 return std::get<Tuple_find_index<Tuple, Pred>>(tuple);
185template <
class Tuple,
class Type>
187 Tuple, detail::Is_same_helper<Type>::template
Predicate>;
198template <
class Tuple,
template <
class>
class Pred>
True if the tuple has an element of the given type.
Definition: tuple_find.h:186
True if at least one element type in the tuple-like type mathes the type predicate.
Definition: tuple_find.h:156
Definition: fts0fts.cc:236
bool index(const std::string &value, const String &search_for, uint32_t *idx)
Definition: contains.h:76
ValueType value(const std::optional< ValueType > &v)
Definition: gtid.h:83
Definition: gtid_format.h:47
Tuple_find_helper< Tuple, Pred >::type Tuple_find
The first element type in the tuple-like type that matches the type predicate.
Definition: tuple_find.h:132
constexpr std::size_t Tuple_matching_element_type_count
The number of tuple element types that match the given predicate.
Definition: tuple_find.h:199
constexpr std::size_t Tuple_find_index
Index of the first element of the tuple-like type whose type matches the type predicate.
Definition: tuple_find.h:109
auto tuple_find(const Tuple &tuple)
Return the value of the first component of the tuple-like object whose type matches the given type pr...
Definition: tuple_find.h:175
A filter of some sort that is not a join condition (those are stored in JoinPredicate objects).
Definition: access_path.h:133
Specialization of Tuple_count_helper to the case where index is in range.
Definition: tuple_find.h:77
Primary template for helper struct used to define Tuple_find_index.
Definition: tuple_find.h:66
Specialization of Tuple_find_helper to the case where the component at position index satisfies the p...
Definition: tuple_find.h:51
Primary template for helper struct used to define Tuple_find_index.
Definition: tuple_find.h:43
Struct template with with one template argument, having a member type Predicate, which is a type pred...
Definition: tuple_find.h:84