quadgrid 0.1
simple cartesian quad grid with particles for c++/octave
Loading...
Searching...
No Matches
range< N >::iterator Struct Reference

#include <counter.h>

Public Types

using difference_type = typename std::make_signed_t<N>
using iterator_category = std::random_access_iterator_tag
using value_type = N
using reference = N
using pointer = const N*

Public Member Functions

iterator & operator++ ()
iterator operator++ (int)
reference operator* () const
bool operator== (const iterator &other) const
bool operator!= (const iterator &other) const
bool operator< (const iterator &other) const
difference_type operator- (const iterator &other) const
iterator operator- (const difference_type other) const
iterator operator+ (const difference_type other) const
value_type operator[] (const value_type &idx)

Protected Member Functions

 iterator (difference_type start)

Private Attributes

N i_

Friends

class range

Detailed Description

template<typename N>
struct range< N >::iterator

Definition at line 9 of file counter.h.

Member Typedef Documentation

◆ difference_type

template<typename N>
using range< N >::iterator::difference_type = typename std::make_signed_t<N>

Definition at line 12 of file counter.h.

◆ iterator_category

template<typename N>
using range< N >::iterator::iterator_category = std::random_access_iterator_tag

Definition at line 13 of file counter.h.

◆ pointer

template<typename N>
using range< N >::iterator::pointer = const N*

Definition at line 16 of file counter.h.

◆ reference

template<typename N>
using range< N >::iterator::reference = N

Definition at line 15 of file counter.h.

◆ value_type

template<typename N>
using range< N >::iterator::value_type = N

Definition at line 14 of file counter.h.

Constructor & Destructor Documentation

◆ iterator()

template<typename N>
range< N >::iterator::iterator ( difference_type start)
inlineexplicitprotected

Definition at line 28 of file counter.h.

28: explicit iterator(difference_type start) : i_ (start) {};
iterator(difference_type start)
Definition counter.h:28
typename std::make_signed_t< N > difference_type
Definition counter.h:12
Definition counter.h:7

Member Function Documentation

◆ operator!=()

template<typename N>
bool range< N >::iterator::operator!= ( const iterator & other) const
inline

Definition at line 21 of file counter.h.

21{ return i_ != *other; }

◆ operator*()

template<typename N>
reference range< N >::iterator::operator* ( ) const
inline

Definition at line 19 of file counter.h.

19{ return i_; }

◆ operator+()

template<typename N>
iterator range< N >::iterator::operator+ ( const difference_type other) const
inline

Definition at line 26 of file counter.h.

26{ return iterator (static_cast<value_type> (static_cast<difference_type>(i_) + other)); }

◆ operator++() [1/2]

template<typename N>
iterator & range< N >::iterator::operator++ ( )
inline

Definition at line 17 of file counter.h.

17{ ++i_; return *this; }

◆ operator++() [2/2]

template<typename N>
iterator range< N >::iterator::operator++ ( int )
inline

Definition at line 18 of file counter.h.

18{ iterator copy(*this); ++i_; return copy; }

◆ operator-() [1/2]

template<typename N>
iterator range< N >::iterator::operator- ( const difference_type other) const
inline

Definition at line 25 of file counter.h.

25{ return iterator (static_cast<value_type> (static_cast<difference_type>(i_) - other)); }

◆ operator-() [2/2]

template<typename N>
difference_type range< N >::iterator::operator- ( const iterator & other) const
inline

Definition at line 24 of file counter.h.

24{ return static_cast<difference_type>(i_) - static_cast<difference_type>(*other); }

◆ operator<()

template<typename N>
bool range< N >::iterator::operator< ( const iterator & other) const
inline

Definition at line 23 of file counter.h.

23{ return i_ < *other; }

◆ operator==()

template<typename N>
bool range< N >::iterator::operator== ( const iterator & other) const
inline

Definition at line 20 of file counter.h.

20{ return i_ == *other; }

◆ operator[]()

template<typename N>
value_type range< N >::iterator::operator[] ( const value_type & idx)
inline

Definition at line 27 of file counter.h.

27{ return i_ + idx; }

◆ range

template<typename N>
friend class range
friend

Definition at line 11 of file counter.h.

Member Data Documentation

◆ i_

template<typename N>
N range< N >::iterator::i_
private

Definition at line 30 of file counter.h.


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