Ultra 0.9.4
Loading...
Searching...
No Matches
layered_population::base_iterator< I > Class Template Reference

Public Types

using iterator_category = std::forward_iterator_tag
using value_type = I
using pointer = value_type *
using const_pointer = const value_type *
using reference = value_type &
using const_reference = const value_type &
using difference_type = std::ptrdiff_t
using ptr = std::conditional_t<is_const, const_pointer, pointer>
using ref = std::conditional_t<is_const, const_reference, reference>
using pop
using itr

Public Member Functions

 base_iterator (pop &p, bool begin) noexcept
base_iterator & operator++ () noexcept
base_iterator operator++ (int) noexcept
bool operator== (const base_iterator &other) const noexcept
std::size_t uid () const noexcept
layered_population< I >::coord coord () const noexcept
ref operator* () const noexcept
ptr operator-> () const noexcept

Friends

std::ostream & operator<< (std::ostream &out, const base_iterator &i)

Detailed Description

template<Individual I>
class layered_population::base_iterator< I >

Iterator for scanning individuals of a layered population.

Member Typedef Documentation

◆ itr

template<Individual I>
using layered_population::base_iterator< I >::itr
Initial value:
std::conditional_t<is_const,
typename pop::layer_const_iter,
typename pop::layer_iter>

◆ pop

template<Individual I>
using layered_population::base_iterator< I >::pop
Initial value:
std::conditional_t<is_const,
const layered_population, layered_population>

Constructor & Destructor Documentation

◆ base_iterator()

template<Individual I>
layered_population::base_iterator< I >::base_iterator ( pop & p,
bool begin )
inlinenoexcept
Parameters
[in]pa population
[in]beginfalse for the end() iterator

Member Function Documentation

◆ operator*()

template<Individual I>
ref layered_population::base_iterator< I >::operator* ( ) const
inlinenodiscardnoexcept
Returns
reference to the current individual

◆ operator++() [1/2]

template<Individual I>
base_iterator & layered_population::base_iterator< I >::operator++ ( )
inlinenoexcept

Prefix increment operator.

Returns
iterator to the next individual
Warning
Advancing past the end() iterator results in undefined behaviour.

◆ operator++() [2/2]

template<Individual I>
base_iterator layered_population::base_iterator< I >::operator++ ( int )
inlinenoexcept

Postfix increment operator.

Returns
iterator to the current individual

◆ operator->()

template<Individual I>
ptr layered_population::base_iterator< I >::operator-> ( ) const
inlinenodiscardnoexcept
Returns
pointer to the current individual

◆ operator==()

template<Individual I>
bool layered_population::base_iterator< I >::operator== ( const base_iterator< I > & other) const
inlinenodiscardnoexcept
Returns
true if iterators point to corresponding individuals

Equality is intentionally defined only in terms of the current layer iterator and offset within that layer. We do not default this comparison because cached implementation details that do not identify the position could make two independently-created iterators to the same individual compare unequal, violating the multi-pass guarantee required by forward iterators.


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