ThinSQLite++
A thin, safe and convenient modern C++ wrapper for SQLite API.
Loading...
Searching...
No Matches
row_iterator Class Reference

A forward iterator for statement results. More...

Inheritance diagram for row_iterator:
row

Public Types

using value_type = row
 
using size_type = int
 
using difference_type = int
 
using reference = row
 
using pointer = void
 
using iterator_category = std::forward_iterator_tag
 

Public Member Functions

 row_iterator () noexcept
 Create an empty iterator.
 
 row_iterator (statement *owner)
 Create an instance referring to a given statement.
 
 row_iterator (std::unique_ptr< statement > &owner)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
row operator* () const noexcept
 
const rowoperator-> () const noexcept
 
row_iteratoroperator++ ()
 
row_iterator operator++ (int)
 

Friends

bool operator== (const row_iterator &lhs, const row_iterator &rhs) noexcept
 
bool operator!= (const row_iterator &lhs, const row_iterator &rhs) noexcept
 

Detailed Description

A forward iterator for statement results.

This class stores the statement by reference. Thus statement must remain valid for the lifetime duration of this class.

#include <thinsqlitepp/statement.hpp>

Constructor & Destructor Documentation

◆ row_iterator() [1/2]

row_iterator ( )
inlinenoexcept

Create an empty iterator.

Such iterator is usable as an end of range sentinel

◆ row_iterator() [2/2]

row_iterator ( statement * owner)
inline

Create an instance referring to a given statement.

Note that the iterator mutates the statement while iterating, hence the argument must be non-const.