24#ifndef MYSQL_RANGES_TRANSFORM_VIEW_H
25#define MYSQL_RANGES_TRANSFORM_VIEW_H
49template <
class Transform_tp, std::input_iterator Source_iterator_tp>
52 Transform_iterator<Transform_tp, Source_iterator_tp>> {
63 [[nodiscard]]
decltype(
auto)
get()
const {
76 requires std::random_access_iterator<Source_iterator_t>
87 requires std::random_access_iterator<Source_iterator_t>
101template <
class Transform_t, std::input_iterator Source_iterator_t>
119template <
class Self_tp,
class Transform_tp, std::ranges::range Source_tp>
122 Transform_interface<Self_tp, Transform_tp, Source_tp>> {
131 return make_transform_iterator<Transform_t>(
source().
begin());
133 [[nodiscard]]
auto end() {
134 return make_transform_iterator<Transform_t>(
source().
end());
137 return make_transform_iterator<Transform_t>(
source().
begin());
139 [[nodiscard]]
auto end()
const {
140 return make_transform_iterator<Transform_t>(
source().
end());
142 [[nodiscard]]
auto size() const
144 std::declval<const Self_tp>().transform_source().size();
151 std::declval<const Self_tp>().transform_source().empty();
158 [[nodiscard]]
const auto &
source()
const {
159 return static_cast<const Self_tp *
>(
this)->transform_source();
162 return static_cast<Self_tp *
>(
this)->transform_source();
171template <
class Transform_tp, std::ranges::range Source_tp>
174 Transform_tp, Source_tp>,
175 public std::ranges::view_base {
198template <
class Transform_t, std::ranges::range Source_t>
CRTP base class (mixin) that makes your class a standard-compliant iterator, given only a minimal set...
Definition: iterator_interface.h:370
CRTP base class to provide members of a collection based on an implementation that provides begin/end...
Definition: collection_interface.h:90
Wrapper around an object that is the source for a view: the wrapped object is owned by this object if...
Definition: view_sources.h:101
const Source_t & reference() const
Return a reference to the stored object.
Definition: view_sources.h:130
Definition: buffer_interface.h:40
auto make_transform_iterator(const Source_iterator_t &iterator)
Factory function to create a Transform_iterator.
Definition: transform_view.h:102
auto make_transform_view(const Source_t &source)
Factory function to create a Transform_view.
Definition: transform_view.h:199
std::remove_cvref_t< decltype(std::declval< Range_t >().begin())> Range_iterator_type
Gives the iterator type, deduced from the begin() member.
Definition: meta.h:42
std::basic_string< Char > transform(std::basic_string_view< Char > s, F fun)
Definition: utils_string.h:53
Define std::hash<Gtid>.
Definition: gtid.h:355
repeated Source source
Definition: replication_asynchronous_connection_failover.proto:42