class concat_iterator

Declaration

template <typename ValueT, typename... IterTs>
class concat_iterator { /* full declaration omitted */ };

Description

Iterator wrapper that concatenates sequences together. This can concatenate different iterators, even with different types, into a single iterator provided the value types of all the concatenated iterators expose `reference` and `pointer` types that can be converted to `ValueT & ` and `ValueT *` respectively. It doesn't support more interesting/customized pointer or reference types. Currently this only supports forward or higher iterator categories as inputs and always exposes a forward iterator interface.

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

Templates

ValueT
IterTs

Member Variables

private std::tuple<IterTs...> Begins
Note that something like iterator_range seems nice at first here, but the range properties are of little benefit and end up getting in the way because we need to do mutation on the current iterators.
private std::tuple<IterTs...> Ends

Method Overview

  • public template <typename... RangeTs> concat_iterator<ValueT, IterTs...>(RangeTs &&... Ranges)
  • private template <size_t... Ns>ValueT & get(std::index_sequence<Ns...>) const
  • private template <size_t Index>ValueT * getHelper() const
  • private template <size_t... Ns>void increment(std::index_sequence<Ns...>)
  • private template <size_t Index>bool incrementHelper()

Methods

template <typename... RangeTs>
concat_iterator<ValueT, IterTs...>(
    RangeTs&&... Ranges)

Description

Constructs an iterator from a sequence of ranges. We need the full range to know how to switch between each of the iterators.

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

Templates

RangeTs

Parameters

RangeTs&&... Ranges

template <size_t... Ns>
ValueT& get(std::index_sequence<Ns...>) const

Description

Finds the first non-end iterator, dereferences, and returns the resulting reference. It is an error to call this with all iterators at the end.

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

Templates

size_t Ns

Parameters

std::index_sequence<Ns...>

template <size_t Index>
ValueT* getHelper() const

Description

Returns null if the specified iterator is at the end. Otherwise, dereferences the iterator and returns the address of the resulting reference.

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

Templates

size_t Index

template <size_t... Ns>
void increment(std::index_sequence<Ns...>)

Description

Increments the first non-end iterator. It is an error to call this with all iterators at the end.

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

Templates

size_t Ns

Parameters

std::index_sequence<Ns...>

template <size_t Index>
bool incrementHelper()

Description

Attempts to increment a specific iterator. Returns true if it was able to increment the iterator. Returns false if the iterator is already at the end iterator.

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

Templates

size_t Index