NPRPC docs

struct iterator

C++

struct iterator

Input iterator for range-for; each increment blocks for the next item.

include/nprpc/stream_reader.hpp:100

Constructors

iterator(StreamReader<T> *reader, bool done)

Positioned at the first item, or at the end when done.

include/nprpc/stream_reader.hpp:109

Fields

std::optional<T> current_

The item operator* returns.

include/nprpc/stream_reader.hpp:104

bool done_ = false

Whether the stream is exhausted.

include/nprpc/stream_reader.hpp:106

StreamReader<T> *reader_

The reader being iterated.

include/nprpc/stream_reader.hpp:102

Operators

bool operator!=(const iterator &other) const

Whether one iterator is at the end and the other is not.

include/nprpc/stream_reader.hpp:119

T &operator*()

The current item.

include/nprpc/stream_reader.hpp:135

iterator &operator++()

Blocks for the next item.

include/nprpc/stream_reader.hpp:125