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

#include <itertools/enumerate.hpp>

Detailed Description

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

Represents an enumerated range.

See itertools::enumerate(R &&) for more details.

Template Parameters
RRange type.

Definition at line 100 of file enumerate.hpp.

Public Types

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

Public Member Functions

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

Public Attributes

rg
 Original range.
 

Member Function Documentation

◆ begin()

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

Beginning of the enumerated range.

Returns
itertools::enum_iter constructed from the beginning of the original range with the index set to zero.

Definition at line 117 of file enumerate.hpp.

◆ end()

template<typename R >
auto itertools::enumerated< R >::end ( )
inlinenodiscardnoexcept

End of the enumerated range.

Returns
itertools::sentinel_t containing the end iterator of the original range.

Definition at line 129 of file enumerate.hpp.


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