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

using iterator_category = std::input_iterator_tag
 Category of iterator.
 
using value_type = result
 Values returned by iterator access.
 
using pointer = result *
 Pointer to iteration values.
 
using reference = result &
 Reference to iteration values.
 
using difference_type = std::ptrdiff_t
 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: