nanodbc
A small C++ wrapper for the native C ODBC API
Loading...
Searching...
No Matches
nanodbc::result_iterator Class Reference

Single pass input iterator that accesses successive rows in the attached result set. More...

#include <nanodbc.h>

Public Types

typedef std::input_iterator_tag iterator_category
 Category of iterator.
 
typedef result value_type
 Values returned by iterator access.
 
typedef resultpointer
 Pointer to iteration values.
 
typedef resultreference
 Reference to iteration values.
 
typedef std::ptrdiff_t difference_type
 Iterator difference.
 

Public Member Functions

 result_iterator ()=default
 Default iterator; an empty result set.
 
 result_iterator (result &r)
 Create result iterator for a given result set.
 
reference operator* () noexcept
 Dereference.
 
pointer operator-> ()
 Access through dereference.
 
result_iteratoroperator++ ()
 Iteration.
 
void operator++ (int)
 Iteration.
 
bool operator== (result_iterator const &rhs) const noexcept
 Iterators are equal if they a tied to the same native statemnt handle, or both empty.
 
bool operator!= (result_iterator const &rhs) const noexcept
 Iterators are not equal if they have different native statemnt handles.
 

Detailed Description

Single pass input iterator that accesses successive rows in the attached result set.

Member Function Documentation

◆ operator++()

void nanodbc::result_iterator::operator++ ( int  )
inline

Iteration.

Note
Returns nothing, so *it++ does not compile: copies of a result_iterator share one cursor, so none can name a row the iterator has moved past. Read through *it before advancing.

The documentation for this class was generated from the following file: