File binary_forward_iterator.hpp

Functions

template<typename Iterator>
static inline BinaryForwardIterator<Iterator> make_binary_forward_iterator(Iterator begin, Iterator end, uint32 index = 0)

Creates and returns a new BinaryForwardIterator.

Template Parameters:

Iterator – The type of the iterator to be adapted

Parameters:
  • begin – An iterator to the beginning of the indices

  • end – An iterator to the end of the indices

  • index – The index to start at

Returns:

A BinaryForwardIterator that has been created

template<typename Iterator>
class BinaryForwardIterator
#include <binary_forward_iterator.hpp>

An iterator adaptor that adapts an iterator, which provides access to a fixed number of indices in increasing order, such that it acts as a forward iterator that returns a boolean value for each possible index, indicating whether the respective index is present in the original iterator or not.

Template Parameters:

Iterator – The type of the iterator to be adapted

Public Types

typedef int difference_type

The type that is used to represent the difference between two iterators.

typedef bool value_type

The type of the elements, the iterator provides access to.

typedef const bool *pointer

The type of a pointer to an element, the iterator provides access to.

typedef bool reference

The type of a reference to an element, the iterator provides access to.

typedef std::forward_iterator_tag iterator_category

The tag that specifies the capabilities of the iterator.

Public Functions

inline BinaryForwardIterator(Iterator begin, Iterator end, uint32 index)
Parameters:
  • begin – An iterator to the beginning of the indices

  • end – An iterator to the end of the indices

  • index – The index to start at

inline reference operator*() const

Returns the element, the iterator currently refers to.

Returns:

The element, the iterator currently refers to

inline BinaryForwardIterator<Iterator> &operator++()

Returns an iterator to the next element.

Returns:

A reference to an iterator that refers to the next element

inline BinaryForwardIterator<Iterator> &operator++(int n)

Returns an iterator to the next element.

Returns:

A reference to an iterator that refers to the next element

inline bool operator!=(const BinaryForwardIterator<Iterator> &rhs) const

Returns whether this iterator and another one refer to the same element.

Parameters:

rhs – A reference to another iterator

Returns:

True, if the iterators do not refer to the same element, false otherwise

inline bool operator==(const BinaryForwardIterator<Iterator> &rhs) const

Returns whether this iterator and another one refer to the same element.

Parameters:

rhs – A reference to another iterator

Returns:

True, if the iterators refer to the same element, false otherwise

Private Members

Iterator iterator_
Iterator end_
uint32 index_
uint32 iteratorIndex_