Class Line::iterator

Nested Relationships

This class is a nested type of Template Class Bresenham2i::Line.

Nested Types

Class Documentation

class iterator

Bresenham’s 2D line drawing iterator, one cell at a time.

Public Types

using iterator_category = std::forward_iterator_tag

Iterator category tag.

using difference_type = std::ptrdiff_t

Iterator difference type (as required by ranges::view_).

using value_type = Vector2

Iterated value type.

using pointer = Vector2*

Pointer to iterated value type.

using reference = Vector2&

Reference to iterated value type.

Public Functions

iterator() = default

Default constructor.

inline explicit iterator(const Line *line)

Constructs a Bresenham’s 2D line iterator.

inline iterator operator++(int)

Post-fix operator overload.

inline iterator &operator++()

Prefix operator overload.

inline const Vector2 &operator*() const

Dereference operator overload (only const).

inline const Vector2 *operator->() const

Arrow operator overload (only const).

inline bool operator==(const iterator &other) const

Equality operator overload (as required by std::forward_iterator).

inline bool operator!=(const iterator &other) const

Inequality operator overload (as required by std::forward_iterator).

inline bool operator==(const sentinel&) const

Sentinel equality operator overload.

inline bool operator!=(const sentinel &other) const

Sentinel inequality operator overload.

struct sentinel

Past-of-end iterator sentinel.

Public Functions

inline bool operator==(const iterator &other) const

Equality operator overload, for symmetry (as required by ranges::sentinel_for).

inline bool operator!=(const iterator &other) const

Inequality operator overload, for symmetry (as required by ranges::sentinel_for).