#include "diplib/distribution.h"
template<typename T>
IteratorTemplate class
An iterator for dip::Distribution
. Dereferences into a Sample
or a ConstSample
(the value of T
).
Contents
Constructors, destructors, assignment and conversion operators
- IteratorTemplate() deleted
- Not default constructable
- IteratorTemplate(dip::Distribution::IteratorTemplate&& ) defaulted
- Move constructor
- IteratorTemplate(dip::Distribution::IteratorTemplate const& ) defaulted
- Copy constructor
- auto operator=(dip::Distribution::IteratorTemplate&& other) -> dip::Distribution::IteratorTemplate& noexcept
- Move assignment, identical to copy assignment
- auto operator=(dip::Distribution::IteratorTemplate const& other) -> dip::Distribution::IteratorTemplate& noexcept
- Copy assignment
Aliases
- using iterator_category = std::random_access_iterator_tag
- Iterator category
- using value_type = T
- The data type obtained when dereferencing the iterator
- using difference_type = dip::sint
- The type of difference between iterators
- using reference = dip::Distribution::IteratorTemplate::value_type&
- The type of a reference to a sample
- using pointer = dip::Distribution::IteratorTemplate::value_type*
- The type of a pointer to a sample
Operators
- auto operator*() -> dip::Distribution::IteratorTemplate::value_type& noexcept
- Dereference
- auto operator->() -> dip::Distribution::IteratorTemplate::value_type* noexcept
- Dereference
-
template<typename I, typename <SFINAE>>auto operator[](I index) const -> dip::Distribution::IteratorTemplate::value_type
- Return sample
index
values away from the current location - auto operator++() -> dip::Distribution::IteratorTemplate&
- Pre-increment
- auto operator--() -> dip::Distribution::IteratorTemplate&
- Pre-decrement
- auto operator++(int ) -> dip::Distribution::IteratorTemplate
- Post-increment
- auto operator--(int ) -> dip::Distribution::IteratorTemplate
- Post-decrement
-
template<typename I, typename <SFINAE>>auto operator+=(I index) -> dip::Distribution::IteratorTemplate&
- Move iterator forward by
index
elements -
template<typename I, typename <SFINAE>>auto operator-=(I index) -> dip::Distribution::IteratorTemplate&
- Move iterator backward by
index
elements -
template<typename I, typename <SFINAE>>auto operator+(I n) -> dip::Distribution::IteratorTemplate
- Returns new iterator moved forward by
n
elements -
template<typename I, typename <SFINAE>>auto operator-(I n) -> dip::Distribution::IteratorTemplate
- Returns new iterator moved backward by
n
elements - auto operator-(dip::Distribution::IteratorTemplate const& it) const -> dip::Distribution::IteratorTemplate::difference_type
- Returns distance between two iterators
- auto operator==(dip::Distribution::IteratorTemplate const& other) const -> bool
- Equality comparison
- auto operator!=(dip::Distribution::IteratorTemplate const& other) const -> bool
- Inequality comparison