class indexed_accessor_range

Declaration

template <typename DerivedT,
          typename BaseT,
          typename T,
          typename PointerT = T*,
          typename ReferenceT = T&>
class indexed_accessor_range { /* full declaration omitted */ };

Description

This class provides an implementation of a range of indexed_accessor_iterators where the base is not indexable. Ranges with bases that are offsetable 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.

Declared at: llvm/include/llvm/ADT/STLExtras.h:1278

Templates

DerivedT
BaseT
T
PointerT = T *
ReferenceT = T &

Method Overview

Methods

static ReferenceT dereference_iterator(
    const std::pair<BaseT, ptrdiff_t>& base,
    ptrdiff_t index)

Description

See `detail::indexed_accessor_range_base` for details.

Declared at: llvm/include/llvm/ADT/STLExtras.h:1305

Parameters

const std::pair<BaseT, ptrdiff_t>& base
ptrdiff_t index

const BaseT& getBase() const

Description

Returns the current base of the range.

Declared at: llvm/include/llvm/ADT/STLExtras.h:1291

ptrdiff_t getStartIndex() const

Description

Returns the current start index of the range.

Declared at: llvm/include/llvm/ADT/STLExtras.h:1294

indexed_accessor_range<DerivedT,
                       BaseT,
                       T,
                       PointerT,
                       ReferenceT>(
    BaseT base,
    ptrdiff_t startIndex,
    ptrdiff_t count)

Declared at: llvm/include/llvm/ADT/STLExtras.h:1282

Parameters

BaseT base
ptrdiff_t startIndex
ptrdiff_t count

static std::pair<BaseT, ptrdiff_t> offset_base(
    const std::pair<BaseT, ptrdiff_t>& base,
    ptrdiff_t index)

Description

See `detail::indexed_accessor_range_base` for details.

Declared at: llvm/include/llvm/ADT/STLExtras.h:1298

Parameters

const std::pair<BaseT, ptrdiff_t>& base
ptrdiff_t index