|
| class | Buffer_interface |
| | CRTP base class that provides a rich API for classes that behave like byte buffers. More...
|
| |
| class | Collection_interface |
| | CRTP base class to provide members of a collection based on an implementation that provides begin/end iterators. More...
|
| |
| struct | Default_unfold |
| | Default Unfold class. More...
|
| |
| class | Disjoint_pairs_interface |
| | CRTP base used to define classes that yield disjoint, adjacent pairs of elements from an even-length source sequence. More...
|
| |
| class | Disjoint_pairs_iterator |
| | Iterator used by Disjoint_pairs_interface and Disjoint_pairs_view: this yields the disjoint, adjacent pairs of values from the source iterator. More...
|
| |
| class | Disjoint_pairs_view |
| | View over an even-length sequence, yielding the disjoint, adjacent pairs of elements. More...
|
| |
| class | Flat_iterator |
| | Iterator adaptor that recursively flattens the sequence of a given iterator over a nested sequence. More...
|
| |
| class | Flat_view |
| | Forward declaration. More...
|
| |
| class | Iterator_with_range |
| | Iterator that holds a reference to its source range. More...
|
| |
| class | Optional_view_source |
| | std::optional-like wrapper around an object that is the source for a view: this may hold an object or not; and the wrapped object is owned by this object if the wrapped object's type satisfies std::ranges::view, and not owned otherwise. More...
|
| |
| class | Transform_interface |
| | CRTP base class / mixin used to define ranges that provide Transform_iterators. More...
|
| |
| class | Transform_iterator |
| | Iterator adaptor that applies a transformation on each value before returning it. More...
|
| |
| class | Transform_view |
| | View whose iterators provide transformed values. More...
|
| |
| class | View_source |
| | Wrapper around an object that is the source for a view: the wrapped object is owned by this object if the wrapped object's type satisfies std::ranges::view, and not owned otherwise. More...
|
| |
|
| template<class Source_t , class Unfold_t > |
| using | Unfolded_type = std::remove_cvref_t< decltype(Unfold_t::unfold(std::declval< Source_t >()))> |
| | Provides the type of the range returned from unfold<Unfold_t>(Source_t). More...
|
| |
| template<class Source_t , class Unfold_t > |
| using | Flat_view_type = std::remove_cvref_t< decltype(make_flat_view< Unfold_t >(std::declval< Source_t >()))> |
| | Type of the flat view returned from make_flat_view<Unfold_t>(Source_T&). More...
|
| |
| template<class Range_t > |
| using | Range_iterator_type = std::remove_cvref_t< decltype(std::declval< Range_t >().begin())> |
| | Gives the iterator type, deduced from the begin() member. More...
|
| |
| template<class Range_t > |
| using | Range_const_iterator_type = std::remove_cvref_t< decltype(std::declval< const Range_t >().begin())> |
| | Gives the const_iterator type, deduced from the begin() const member. More...
|
| |
| template<class Range_t > |
| using | Range_sentinel_type = std::remove_cvref_t< decltype(std::declval< Range_t >().end())> |
| | Gives the iterator type, deduced from the end() member. More...
|
| |
| template<class Iterator_t > |
| using | Iterator_value_type = std::remove_cvref_t< decltype(*std::declval< Iterator_t >())> |
| | Gives the value type for any iterator type, deduced from operator *. More...
|
| |
| template<class Range_t > |
| using | Range_value_type = Iterator_value_type< Range_iterator_type< Range_t > > |
| | Gives the value type for any collection, deduced from *begin(). More...
|
| |
| template<class Map_t > |
| using | Map_key_type = std::remove_cvref_t< decltype(std::declval< Map_t >().begin() ->first)> |
| | Gives the key type for any collection, deduced from begin()->first. More...
|
| |
| template<class Map_t > |
| using | Map_mapped_type = std::remove_cvref_t< decltype(std::declval< Map_t >().begin() ->second)> |
| | Gives the mapped type for any collection, deduced from begin()->first. More...
|
| |
| template<std::size_t index_tp, std::input_iterator Source_iterator_tp> |
| using | Projection_iterator = Transform_iterator< detail::Projection_transform< index_tp >, Source_iterator_tp > |
| | Projection iterator adaptor: given an iterator over tuple-like objects, this is an iterator over the Nth component. More...
|
| |
| template<std::size_t index_tp, std::ranges::range Source_tp> |
| using | Projection_view = Transform_view< detail::Projection_transform< index_tp >, Source_tp > |
| | Projection view: given a range over tuple-like objects, this is a range over the N'th component of those tuples. More...
|
| |
| template<class Value_iterator_t > |
| using | Key_iterator = Projection_iterator< 0, Value_iterator_t > |
| | Iterator adaptor that extracts the first component from tuple-like value types. More...
|
| |
| template<class Source_t > |
| using | Key_view = Projection_view< 0, Source_t > |
| | View over the keys of a range of pairs. More...
|
| |
| template<class Value_iterator_t > |
| using | Mapped_iterator = Projection_iterator< 1, Value_iterator_t > |
| | Iterator adaptor that extracts the second component from tuple-like value types. More...
|
| |
| template<class Source_t > |
| using | Mapped_view = Projection_view< 1, Source_t > |
| | View over the mapped values in a range of pairs. More...
|
| |
| template<class Source_t , bool owns_source_t = std::ranges::view<Source_t>> |
| using | Raw_view_source = std::conditional_t< owns_source_t, Source_t, const Source_t & > |
| | Type alias to represent the source of a view: resolves to Type if std::ranges::view<Type>, or to Type & otherwise. More...
|
| |
|
template<std::derived_from< detail::Buffer_base > Buffer_t>
requires (Buffer_t::equality_algorithm == Equality_algorithm::fast) |
| auto | operator<=> (const Buffer_t &left, const Buffer_t &right) |
| | Enable fast comparison operators for Buffer_interface subclasses. More...
|
| |
template<std::derived_from< detail::Buffer_base > Buffer_t>
requires (Buffer_t::equality_algorithm == Equality_algorithm::lexicographic) |
| auto | operator<=> (const Buffer_t &left, const Buffer_t &right) |
| | Enable lexicographic comparison operators for Buffer_interface subclasses. More...
|
| |
template<std::derived_from< detail::Buffer_base > Buffer_t>
requires Buffer_t |
| ::equality_enabled bool | operator== (const Buffer_t &left, const Buffer_t &right) |
| | Enable operator== for Buffer_interface subclasses. More...
|
| |
template<std::derived_from< detail::Buffer_base > Buffer_t>
requires Buffer_t |
| ::equality_enabled bool | operator!= (const Buffer_t &left, const Buffer_t &right) |
| | Enable operator!= for Buffer_interface subclasses. More...
|
| |
| template<class Pair_t = detail::Make_pair, class Iterator_t > |
| auto | make_disjoint_pairs_iterator (const Iterator_t &position) |
| | Factory function to create a Disjoint_pairs_iterator. More...
|
| |
| template<class Make_pair_t = detail::Make_pair, class Source_t > |
| auto | make_disjoint_pairs_view (const Source_t &source) |
| | Factory to construct a Disjoint_pairs_view from a given range. More...
|
| |
| template<class Unfold_t = Default_unfold, Can_unfold_with< Unfold_t > Source_t> |
| decltype(auto) | make_flat_view (const Source_t &source) |
| | Factory function to create a range view over a flattened sequence of elements from given source. More...
|
| |
| template<class Unfold_t , class Range_t > |
| auto | make_flat_iterator (const Range_t &range, const Range_const_iterator_type< Range_t > &iterator) |
| | Returns a flat iterator over the range starting at iterator. More...
|
| |
| template<std::size_t index_t, std::input_iterator Tuple_iterator_t> |
| auto | make_projection_iterator (const Tuple_iterator_t &iterator) |
| | Factory function to create a Projection_iterator. More...
|
| |
| template<std::size_t index_t, std::ranges::range Source_t> |
| auto | make_projection_view (const Source_t &source) |
| | Factory function to create a Projection_view. More...
|
| |
| auto | make_key_iterator (const auto &iterator) |
| | Factory function to create a new iterator from a given iterator over pairs. More...
|
| |
| auto | make_key_view (const auto &source) |
| | Factory function to create a new view over the keys in a range of pairs. More...
|
| |
| auto | make_mapped_iterator (const auto &iterator) |
| | Factory function to create a new iterator from a given iterator over pairs. More...
|
| |
| auto | make_mapped_view (const auto &source) |
| | Factory function to create a new view over the mapped values in a range of pairs. More...
|
| |
| template<class Transform_t , std::input_iterator Source_iterator_t> |
| auto | make_transform_iterator (const Source_iterator_t &iterator) |
| | Factory function to create a Transform_iterator. More...
|
| |
| template<class Transform_t , std::ranges::range Source_t> |
| auto | make_transform_view (const Source_t &source) |
| | Factory function to create a Transform_view. More...
|
| |
| template<class Source_t > |
| auto | make_view_source (const Source_t &source) |
| | Factory function to create a View_source wrapping the given object. More...
|
| |
| template<class Source_t > |
| auto | make_optional_view_source (const Source_t &source) |
| | Factory function to create an Optional_view_source wrapping the given object. More...
|
| |
| template<class Source_t > |
| auto | make_optional_view_source (const Source_t *source) |
| | Factory function to create an Optional_view_source wrapping the pointed-to object. More...
|
| |
template<class Source_t , bool owns_source_t = std::ranges::view<Source_t>>
Type alias to represent the source of a view: resolves to Type if std::ranges::view<Type>, or to Type & otherwise.
This is meant to be used by member variables of the view class, or the view's iterator class, that need to reference the source.
This intends to prevent dangling references by enforcing the following rule:
"Views and their iterators shall represent sources that are views
by-value, and sources that are containers by-reference."
For full justification, see readme.md.
Since references are not default-constructible, a view or view iterator that has a member of this type becomes non-default-constructible when the source is not a view. If you need default-constructibility, use View_source instead. The benefit of this class is that it does not require indirection to access the T object.
Note that types need to be declared explicitly as views, using either std::ranges::view_base or std::ranges::enable_range.
- Template Parameters
-
| Source_t | The source type. |
| owns_source_t | Determines if the object owns its source. By default, this is deduced from std::ranges::view<Source_t>. |
template<class Unfold_t = Default_unfold, Can_unfold_with< Unfold_t > Source_t>
| decltype(auto) mysql::ranges::make_flat_view |
( |
const Source_t & |
source | ) |
|
Factory function to create a range view over a flattened sequence of elements from given source.
For example, if source is of type std::vector<std::map<A, std::list<B>>>, make_flat_view(source) is a range view over B objects.
In case any map or list is empty, it is only skipped over; the resulting range contains only valid elements and no "gaps".
- Template Parameters
-
| Unfold_t | Unfold class. This is used to obtain ranges from the source, and from its sub-objects. For example, we expect make_flat_view(std::map<A, std::map<B, C>>&) to provide iterators over C. While unfolding the outer map, the implementation needs a range over std::map<B, C> objects, and while unfolding each such inner std::map<B, C> object, the implementation needs a range over C objects. But std::map does not give that; it only gives ranges over std::pair<A, std::map<B, C>> and std::pair<B, C>. In such cases, the user needs to provide a custom Unfold class through this parameter, which should have a member function unfold(std::map<X, Y>) returning a range over Y objects. |
| Source_t | Type of source. |
- Parameters
-