TRIQS/itertools 1.3.0
C++ range library
Loading...
Searching...
No Matches
itertools::strided< R >

#include <itertools/stride.hpp>

Detailed Description

template<typename R>
struct itertools::strided< R >

Represents a strided range.

See itertools::stride(R &&, std::ptrdiff_t) for more details.

Template Parameters
RRange type.

Definition at line 92 of file stride.hpp.

Public Types

using const_iterator = stride_iter<decltype(std::cbegin(rg))>
 Const iterator type of the strided range.
 
using iterator = stride_iter<decltype(std::begin(rg))>
 Iterator type of the strided range.
 

Public Member Functions

const_iterator begin () const noexcept
 Const overload of begin().
 
iterator begin () noexcept
 Beginning of the strided range.
 
const_iterator cbegin () const noexcept
 Const version of begin().
 
const_iterator cend () const noexcept
 Const version of end().
 
const_iterator end () const noexcept
 Const overload of end().
 
iterator end () noexcept
 End of the strided range.
 
bool operator== (strided const &) const =default
 Default equal-to operator.
 

Public Attributes

rg
 Original range.
 
std::ptrdiff_t stride
 Number of elements in the original range to skip when incrementing the iterator.
 

Member Function Documentation

◆ begin()

template<typename R >
iterator itertools::strided< R >::begin ( )
inlinenodiscardnoexcept

Beginning of the strided range.

Returns
itertools::stride_iter containing the begin iterator of the original range and the stride.

Definition at line 120 of file stride.hpp.

◆ end()

template<typename R >
iterator itertools::strided< R >::end ( )
inlinenodiscardnoexcept

End of the strided range.

Returns
itertools::stride_iter containing an iterator of the original range end_offset() elements beyond the beginning and the stride.

Definition at line 133 of file stride.hpp.


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