ALP User Documentation  0.8.preview
Algebraic Programming User Documentation
Public Member Functions | List of all members
Vector< D, implementation, C >::const_iterator Class Reference

A standard iterator for the Vector< D > class. More...

Inherits iterator< std::forward_iterator_tag, std::pair< const size_t, const D >, size_t >.

Public Member Functions

bool operator!= (const const_iterator &other) const
 
std::pair< const size_t, const D > operator* () const
 Dereferences the current position of this iterator. More...
 
const_iteratoroperator++ ()
 Advances the position of this iterator by one. More...
 
bool operator== (const const_iterator &other) const
 Standard equals operator. More...
 

Detailed Description

template<typename D, enum Backend implementation, typename C>
class grb::Vector< D, implementation, C >::const_iterator

A standard iterator for the Vector< D > class.

This iterator is used for data extraction only. Hence only this const version is supplied.

Warning
Comparing two const iterators corresponding to different containers leads to undefined behaviour.
Advancing an iterator past the end iterator of the container it corresponds to leads to undefined behaviour.
Modifying the contents of a container makes any use of any iterator derived from it incur invalid behaviour.
Note
These are standard limitations of STL iterators.

Member Function Documentation

◆ operator!=()

bool operator!= ( const const_iterator other) const
inline
Returns
The negation of operator==().

◆ operator*()

std::pair< const size_t, const D > operator* ( ) const
inline

Dereferences the current position of this iterator.

Returns
If this iterator is valid and not in end position, this returns a new std::pair with in its first field the position of the nonzero value, and in its second field the value of the nonzero.
Note
If this iterator is invalid or in end position, the result is, undefined.

◆ operator++()

const_iterator& operator++ ( )
inline

Advances the position of this iterator by one.

If the current position corresponds to the last element in the container, the new position of this iterator will be its end position.

If the current position of this iterator is already the end position, this iterator will become invalid; any use of invalid iterators will lead to undefined behaviour.

Returns
A reference to this iterator.

◆ operator==()

bool operator== ( const const_iterator other) const
inline

Standard equals operator.


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