Prism Ruby parser
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Friends
prism::detail::next_range< T, Next >::iterator Class Reference

Steps through the items one after another. More...

#include <parser.hpp>

Public Types

using iterator_category = std::forward_iterator_tag
 The iterator category, for the standard algorithms.
 
using value_type = const T *
 The type of each element.
 
using difference_type = std::ptrdiff_t
 The type of the distance between two iterators.
 
using pointer = const value_type *
 The type of a pointer to an element.
 
using reference = const value_type &
 The type of a reference to an element.
 

Public Member Functions

 iterator () noexcept=default
 Create the iterator that marks the end of the items.
 
 iterator (const T *current) noexcept
 Create an iterator at the given item.
 
reference operator* () const noexcept
 The item at this position, which must not be the end.
 
iterator & operator++ () noexcept
 Advance to the next item.
 
iterator operator++ (int) noexcept
 Advance to the next item, returning the iterator from before.
 

Friends

bool operator== (iterator left, iterator right) noexcept
 Whether the two iterators are at the same item.
 
bool operator!= (iterator left, iterator right) noexcept
 Whether the two iterators are at different items.
 

Detailed Description

template<typename T, const T *(*)(const T *) Next>
class prism::detail::next_range< T, Next >::iterator

Steps through the items one after another.

Constructor & Destructor Documentation

◆ iterator()

template<typename T , const T *(*)(const T *) Next>
prism::detail::next_range< T, Next >::iterator::iterator ( const T *  current)
inlineexplicitnoexcept

Create an iterator at the given item.

Parameters
currentThe current item.

Member Function Documentation

◆ operator*()

template<typename T , const T *(*)(const T *) Next>
reference prism::detail::next_range< T, Next >::iterator::operator* ( ) const
inlinenoexcept

The item at this position, which must not be the end.

Returns
The current item.

◆ operator++() [1/2]

template<typename T , const T *(*)(const T *) Next>
iterator & prism::detail::next_range< T, Next >::iterator::operator++ ( )
inlinenoexcept

Advance to the next item.

Returns
The iterator after advancing.

◆ operator++() [2/2]

template<typename T , const T *(*)(const T *) Next>
iterator prism::detail::next_range< T, Next >::iterator::operator++ ( int  )
inlinenoexcept

Advance to the next item, returning the iterator from before.

Returns
The iterator from before advancing.

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