SQT
A C++ ORM framework for SQLite
Loading...
Searching...
No Matches
sqt::Iterator< SELECTER > Class Template Reference

#include <sqt/orm/executor/iterator.h>

Description

template<SelecterType SELECTER>
class sqt::Iterator< SELECTER >

Represents the iterator used by sqt::Result<> to iterate over the result elements of a selecter.

Template Parameters
SELECTERThe selecter type on which this iterator is based. The type of the result elements is determined by the selecter type.

The sqt::Iterator<> satisfies the std::input_iterator concept. It is a single-pass iterator, meaning that it can only advance forward and cannot move backward. Due to this limitation and to avoid unnecessary performance overhead, the post-increment operator returns void instead of a previous iterator. As a result, the iterator does not satisfy the LegacyInputIterator concept, which requires *iterator++ to be a valid expression. Consequently, it cannot be used in some standard algorithms and containers that require this concept.

See also
sqt::Result<>
sqt::SelecterType

Public Types

using iterator_category = std::input_iterator_tag
using difference_type = std::ptrdiff_t
using value_type = SELECTER::ResultElementType

Public Member Functions

 Iterator (Statement &statement)
 Iterator (Statement &statement, std::monostate dumb) noexcept
Iteratoroperator++ ()
void operator++ (int)
value_type operator* () const

Friends

bool operator== (const Iterator &iterator1, const Iterator &iterator2) noexcept
bool operator!= (const Iterator &iterator1, const Iterator &iterator2) noexcept