tfel
Loading...
Searching...
No Matches
mfront::generic_parallel::CountingIterator< IndexType > Struct Template Reference

a random access iterator over a range of indices. More...

#include </home/runner/work/tfel/tfel/mfront/include/MFront/GenericParallel/CountingIterator.hxx>

Public Types

using iterator_category = std::random_access_iterator_tag
using value_type = IndexType
using difference_type = std::ptrdiff_t
using pointer = void
using reference = IndexType

Public Member Functions

constexpr reference operator* () const noexcept
constexpr reference operator[] (const difference_type n) const noexcept
constexpr CountingIterator & operator++ () noexcept
constexpr CountingIterator operator++ (int) noexcept
constexpr CountingIterator & operator-- () noexcept
constexpr CountingIterator operator-- (int) noexcept
constexpr CountingIterator & operator+= (const difference_type n) noexcept
constexpr CountingIterator & operator-= (const difference_type n) noexcept

Public Attributes

IndexType i
 current index

Friends

constexpr CountingIterator operator+ (const CountingIterator a, const difference_type n) noexcept
constexpr CountingIterator operator+ (const difference_type n, const CountingIterator a) noexcept
constexpr CountingIterator operator- (const CountingIterator a, const difference_type n) noexcept
constexpr difference_type operator- (const CountingIterator a, const CountingIterator b) noexcept
constexpr auto operator<=> (const CountingIterator &, const CountingIterator &)=default

Detailed Description

template<std::integral IndexType>
struct mfront::generic_parallel::CountingIterator< IndexType >

a random access iterator over a range of indices.

std::views::iota can't be used with the parallel algorithms of some implementations of the standard library: the category of its iterators, in the sense of the C++17 iterators, is not std::random_access_iterator_tag and the algorithms then run sequentially (this is the case of libstdc++).

Template Parameters
IndexTypetype of the index

The documentation for this struct was generated from the following file: