|
| constexpr auto | cbegin () const |
| | Return constant iterator to the beginning. More...
|
| |
| constexpr auto | cend () const |
| | Return constant iterator to the end. More...
|
| |
| constexpr auto | rbegin () |
| | Return reverse iterator to the beginning. More...
|
| |
| constexpr auto | rend () |
| | Return reverse iterator to the end. More...
|
| |
| constexpr auto | rbegin () const |
| | Return const reverse iterator to the beginning. More...
|
| |
| constexpr auto | rend () const |
| | Return const reverse iterator to the end. More...
|
| |
| constexpr auto | crbegin () const |
| | Return const reverse iterator to the beginning. More...
|
| |
| constexpr auto | crend () const |
| | Return const reverse iterator to the end. More...
|
| |
| constexpr bool | empty () const |
| | Return true if the range is empty, i.e., begin() == end(). More...
|
| |
| constexpr | operator bool () const |
| | Return true if the range is non-empty, i.e., begin() != end(). More...
|
| |
| constexpr bool | operator! () const |
| | Return true if the range is empty, i.e., begin() == end(). More...
|
| |
| constexpr auto | size () const |
| | Return the number of elements in this view, unsigned (size_t), by computing std::ranges::distance(begin, end) More...
|
| |
| constexpr auto | ssize () const |
| | Return the number of elements in this view, signed (ptrdiff_t). More...
|
| |
| constexpr decltype(auto) | front () const |
| | Return the first element. More...
|
| |
| constexpr decltype(auto) | back () const |
| | Return the last element. Enabled if we have bidirectional iterators. More...
|
| |
| constexpr decltype(auto) | operator[] (std::ptrdiff_t n) |
| | Return the n'th element, possibly mutable. More...
|
| |
| constexpr decltype(auto) | operator[] (std::ptrdiff_t n) const |
| | Return the n'th element, const. More...
|
| |
| constexpr auto * | data () |
| | Return pointer to underlying contiguous memory. More...
|
| |
| constexpr auto * | data () const |
| | Return const pointer to underlying contiguous memory. More...
|
| |
template<class Self_tp>
class mysql::ranges::Collection_interface< Self_tp >
CRTP base class to provide members of a collection based on an implementation that provides begin/end iterators.
The implementation must implement either begin() and end(), or begin() const and end() const (or all four). It may also override size() const and empty() const, if that is faster than the default implementations, std::ranges::distance(begin(), end()) and begin()==end().
The collection provides the following functionality:
operator bool() const;
rcbegin() const;
rcend() const;
constexpr auto * data()
Return pointer to underlying contiguous memory.
Definition: collection_interface.h:189
constexpr auto cend() const
Return constant iterator to the end.
Definition: collection_interface.h:100
constexpr auto rend()
Return reverse iterator to the end.
Definition: collection_interface.h:108
constexpr bool operator!() const
Return true if the range is empty, i.e., begin() == end().
Definition: collection_interface.h:141
constexpr auto ssize() const
Return the number of elements in this view, signed (ptrdiff_t).
Definition: collection_interface.h:153
constexpr auto size() const
Return the number of elements in this view, unsigned (size_t), by computing std::ranges::distance(beg...
Definition: collection_interface.h:145
constexpr decltype(auto) operator[](std::ptrdiff_t n)
Return the n'th element, possibly mutable.
Definition: collection_interface.h:173
constexpr decltype(auto) back() const
Return the last element. Enabled if we have bidirectional iterators.
Definition: collection_interface.h:161
constexpr decltype(auto) front() const
Return the first element.
Definition: collection_interface.h:156
constexpr auto cbegin() const
Return constant iterator to the beginning.
Definition: collection_interface.h:97
constexpr bool empty() const
Return true if the range is empty, i.e., begin() == end().
Definition: collection_interface.h:133
constexpr auto rbegin()
Return reverse iterator to the beginning.
Definition: collection_interface.h:103
const char * begin(const char *const c)
Definition: base64.h:44
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:192
int n
Definition: xcom_base.cc:509
This is similar to the C++20 feature std::ranges::view_interface. However, not all compilers we build on as of 2025 had implemented view_interface even in C++20 mode. Also, cbegin and cend are C++23 features, and rbegin/rend/rcbegin/rcend/ssize are non-standard.
Despite the similarity with std::ranges::view_interface, we avoid word "view" because C++ defines that to be objects for which copy and move is cheap (https://en.cppreference.com/w/cpp/ranges/view), whereas this class is usable for anything that provides iterators, cheap-copyable or not.