LLVM 20.0.0git
|
The class represents the base of a range of indexed_accessor_iterators. More...
#include "llvm/ADT/STLExtras.h"
Classes | |
class | iterator |
An iterator element of this range. More... | |
Public Types | |
using | RangeBaseT = indexed_accessor_range_base |
Public Member Functions | |
indexed_accessor_range_base (iterator begin, iterator end) | |
indexed_accessor_range_base (const iterator_range< iterator > &range) | |
indexed_accessor_range_base (BaseT base, ptrdiff_t count) | |
iterator | begin () const |
iterator | end () const |
ReferenceT | operator[] (size_t Index) const |
ReferenceT | front () const |
ReferenceT | back () const |
size_t | size () const |
Return the size of this range. | |
bool | empty () const |
Return if the range is empty. | |
DerivedT | slice (size_t n, size_t m) const |
Drop the first N elements, and keep M elements. | |
DerivedT | drop_front (size_t n=1) const |
Drop the first n elements. | |
DerivedT | drop_back (size_t n=1) const |
Drop the last n elements. | |
DerivedT | take_front (size_t n=1) const |
Take the first n elements. | |
DerivedT | take_back (size_t n=1) const |
Take the last n elements. | |
template<typename RangeT , typename = std::enable_if_t<std::is_constructible< RangeT, iterator_range<iterator>>::value>> | |
operator RangeT () const | |
Allow conversion to any type accepting an iterator_range. | |
const BaseT & | getBase () const |
Returns the base of this range. | |
Protected Member Functions | |
indexed_accessor_range_base (const indexed_accessor_range_base &)=default | |
indexed_accessor_range_base (indexed_accessor_range_base &&)=default | |
indexed_accessor_range_base & | operator= (const indexed_accessor_range_base &)=default |
Protected Attributes | |
BaseT | base |
The base that owns the provided range of values. | |
ptrdiff_t | count |
The size from the owning range. | |
The class represents the base of a range of indexed_accessor_iterators.
It provides support for many different range functionalities, e.g. drop_front/slice/etc.. Derived range classes must implement the following static methods:
Definition at line 1239 of file STLExtras.h.
using llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::RangeBaseT = indexed_accessor_range_base |
Definition at line 1241 of file STLExtras.h.
|
inline |
Definition at line 1261 of file STLExtras.h.
|
inline |
Definition at line 1264 of file STLExtras.h.
|
inline |
Definition at line 1266 of file STLExtras.h.
|
protecteddefault |
|
protecteddefault |
|
inline |
|
inline |
Definition at line 1269 of file STLExtras.h.
References llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::base.
|
inline |
Drop the last n elements.
Definition at line 1302 of file STLExtras.h.
References assert(), llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::base, and llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::size().
Referenced by llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::take_front().
|
inline |
Drop the first n elements.
Definition at line 1297 of file STLExtras.h.
References assert(), llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::size(), and llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::slice().
Referenced by llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::take_back().
|
inline |
Return if the range is empty.
Definition at line 1288 of file STLExtras.h.
References llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::size().
Referenced by llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::back(), and llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::front().
|
inline |
|
inline |
Definition at line 1275 of file STLExtras.h.
References assert(), and llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::empty().
|
inline |
Returns the base of this range.
Definition at line 1327 of file STLExtras.h.
References llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::base.
|
inline |
Allow conversion to any type accepting an iterator_range.
Definition at line 1322 of file STLExtras.h.
|
protecteddefault |
|
inline |
|
inline |
Return the size of this range.
Definition at line 1285 of file STLExtras.h.
References llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::count.
Referenced by llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::back(), llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::drop_back(), llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::drop_front(), llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::empty(), llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::operator[](), llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::slice(), llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::take_back(), and llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::take_front().
|
inline |
Drop the first N elements, and keep M elements.
Definition at line 1291 of file STLExtras.h.
References assert(), llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::base, and llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::size().
Referenced by llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::drop_front().
|
inline |
Take the last n elements.
Definition at line 1314 of file STLExtras.h.
References llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::drop_front(), and llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::size().
|
inline |
Take the first n elements.
Definition at line 1308 of file STLExtras.h.
References llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::drop_back(), and llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::size().
|
protected |
The base that owns the provided range of values.
Definition at line 1342 of file STLExtras.h.
Referenced by llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::begin(), llvm::indexed_accessor_range< DerivedT, BaseT, T, PointerT, ReferenceT >::dereference_iterator(), llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::drop_back(), llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::end(), llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::getBase(), llvm::indexed_accessor_range< DerivedT, BaseT, T, PointerT, ReferenceT >::getBase(), llvm::indexed_accessor_range< DerivedT, BaseT, T, PointerT, ReferenceT >::getStartIndex(), llvm::indexed_accessor_range< DerivedT, BaseT, T, PointerT, ReferenceT >::offset_base(), llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::operator[](), and llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::slice().
|
protected |
The size from the owning range.
Definition at line 1344 of file STLExtras.h.
Referenced by llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::end(), and llvm::detail::indexed_accessor_range_base< DerivedT, BaseT, T, PointerT, ReferenceT >::size().