Range of indexed accessor iterators over a non‐indexable base.

Synopsis

Declared in <llvm/ADT/STLExtras.h>

template<
    typename DerivedT,
    typename BaseT,
    typename T,
    typename PointerT = T*,
    typename ReferenceT = T&>
class indexed_accessor_range
    : public /* implementation-defined */

Description

Ranges with offsetable bases should derive from indexed_accessor_range_base instead. Derived range classes are expected to implement the following static method: * ReferenceT dereference(const BaseT &base, ptrdiff_t index)

  • Dereference an iterator pointing to a parent base at the given index.

Base Classes

Name

Description

/* implementation-defined */

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: * ReferenceT dereference_iterator(const BaseT &base, ptrdiff_t index) ‐ Dereference an iterator pointing to the base object at the given index. * BaseT offset_base(const BaseT &base, ptrdiff_t index) ‐ Return a new base that is offset from the provide base by 'index' elements.

Types

Name

Description

iterator

An iterator element of this range.

Type Aliases

Name

Description

RangeBaseT

Self type used by derived range classes.

Member Functions

Name

Description

indexed_accessor_range [constructor]

Construct a range over count elements of base starting at startIndex.

back

Return the last element of the range.

begin

Return an iterator to the first element.

drop_back

Drop the last n elements.

drop_front

Drop the first n elements.

empty

Return if the range is empty.

end

Return an iterator past the last element.

front

Return the first element of the range.

getBase

Returns the current base of the range.

getStartIndex

Returns the current start index of the range.

operator[]

Return the element at Index.

size

Return the size of this range.

slice

Drop the first n elements and keep the next m elements.

take_back

Take the last n elements.

take_front

Take the first n elements.

operator RangeT

Allow conversion to any type accepting an iterator_range.

Static Member Functions

Name

Description

dereference_iterator

Dereference the element at index relative to base.

offset_base

Return base advanced by index elements.

Using Declarations

Name

Description

Unnamed using

Inherit the base range constructors.

Protected Member Functions

Name

Description

operator=

Copy‐assign an indexed accessor range base.

Protected Data Members

Name

Description

base

The base that owns the provided range of values.

count

The size from the owning range.

Created with MrDocs