# pqxx::result::result::const_iterator Class Reference

Iterator for rows (tuples) in a query result set. More...

`#include <result.hxx>`

Inheritance diagram for pqxx::result::result::const_iterator:

[legend]

List of all members.

## Public Types
typedef const tuple * | pointer
typedef tuple | reference
typedef result::size_type | size_type
typedef result::difference_type | difference_type
## Public Member Functions
| const_iterator () throw ()
| const_iterator (const tuple &t) throw ()
Dereferencing operators
pointer | operator-> () const
reference | operator* () const
Manipulations
const_iterator | operator++ (int)
const_iterator & | operator++ ()
const_iterator | operator-- (int)
const_iterator & | operator-- ()
const_iterator & | operator+= (difference_type i)
const_iterator & | operator-= (difference_type i)
Comparisons
bool | operator== (const const_iterator &i) const
bool | operator!= (const const_iterator &i) const
bool | operator< (const const_iterator &i) const
bool | operator<= (const const_iterator &i) const
bool | operator> (const const_iterator &i) const
bool | operator>= (const const_iterator &i) const
## Friends
class | pqxx::result
## Arithmetic operators
const_iterator | operator+ (difference_type, const_iterator)
const_iterator | operator+ (difference_type) const
const_iterator | operator- (difference_type) const
difference_type | operator- (const_iterator) const

## Detailed Description

Iterator for rows (tuples) in a query result set.

A result, once obtained, cannot be modified. Therefore there is no plain iterator type for result. However its const_iterator type can be used to inspect its tuples without changing them.

## Member Typedef Documentation

typedef result::difference_type pqxx::result::result::const_iterator::difference_type

Reimplemented from pqxx::result::result::tuple.

typedef const tuple* pqxx::result::result::const_iterator::pointer

Reimplemented from pqxx::result::result::tuple.

typedef tuple pqxx::result::result::const_iterator::reference

Reimplemented from pqxx::result::result::tuple.

typedef result::size_type pqxx::result::result::const_iterator::size_type

Reimplemented from pqxx::result::result::tuple.

## Constructor & Destructor Documentation

pqxx::result::result::const_iterator::const_iterator | ( |  | ) | throw ()

Referenced by pqxx::result::result::const_iterator::operator+(), and pqxx::result::result::const_iterator::operator-().

pqxx::result::result::const_iterator::const_iterator | ( | const tuple & | t | ) | throw ()

## Member Function Documentation

bool pqxx::result::result::const_iterator::operator!= | ( | const const_iterator & | i | ) | const

reference pqxx::result::result::const_iterator::operator* | ( |  | ) | const

result::const_iterator pqxx::result::result::const_iterator::operator+ | ( | difference_type | o | ) | const

Reimplemented in pqxx::result::result::const_reverse_iterator.

References pqxx::result::result::const_iterator::const_iterator(), pqxx::result::result::tuple::m_Home, and pqxx::result::result::tuple::m_Index.

const_iterator& pqxx::result::result::const_iterator::operator++ | ( |  | ) |

Reimplemented in pqxx::result::result::const_reverse_iterator.

Referenced by pqxx::result::result::const_reverse_iterator::operator--().

pqxx::result::const_iterator pqxx::result::result::const_iterator::operator++ | ( | int |  | ) |

Reimplemented in pqxx::result::result::const_reverse_iterator.

References pqxx::result::result::tuple::m_Index.

const_iterator& pqxx::result::result::const_iterator::operator+= | ( | difference_type | i | ) |

Reimplemented in pqxx::result::result::const_reverse_iterator.

result::const_iterator::difference_type pqxx::result::result::const_iterator::operator- | ( | const_iterator | i | ) | const

References pqxx::result::result::tuple::num().

result::const_iterator pqxx::result::result::const_iterator::operator- | ( | difference_type | o | ) | const

References pqxx::result::result::const_iterator::const_iterator(), pqxx::result::result::tuple::m_Home, and pqxx::result::result::tuple::m_Index.

const_iterator& pqxx::result::result::const_iterator::operator-- | ( |  | ) |

Reimplemented in pqxx::result::result::const_reverse_iterator.

Referenced by pqxx::result::result::const_reverse_iterator::operator++().

pqxx::result::const_iterator pqxx::result::result::const_iterator::operator-- | ( | int |  | ) |

Reimplemented in pqxx::result::result::const_reverse_iterator.

References pqxx::result::result::tuple::m_Index.

const_iterator& pqxx::result::result::const_iterator::operator-= | ( | difference_type | i | ) |

Reimplemented in pqxx::result::result::const_reverse_iterator.

pointer pqxx::result::result::const_iterator::operator-> | ( |  | ) | const

The iterator "points to" its own tuple, which is also itself. This allows a result to be addressed as a two-dimensional container without going through the intermediate step of dereferencing the iterator. I hope this works out to be similar to C pointer/array semantics in useful cases.

IIRC Alex Stepanov, the inventor of the STL, once remarked that having this as standard behaviour for pointers would be useful in some algorithms. So even if this makes me look foolish, I would seem to be in distinguished company.

bool pqxx::result::result::const_iterator::operator< | ( | const const_iterator & | i | ) | const

bool pqxx::result::result::const_iterator::operator<= | ( | const const_iterator & | i | ) | const

bool pqxx::result::result::const_iterator::operator== | ( | const const_iterator & | i | ) | const

References pqxx::result::result::tuple::m_Index.

bool pqxx::result::result::const_iterator::operator> | ( | const const_iterator & | i | ) | const

bool pqxx::result::result::const_iterator::operator>= | ( | const const_iterator & | i | ) | const

## Friends And Related Function Documentation

const_iterator operator+ | ( | difference_type | o,
|  | result::const_iterator | i |
| ) |  |  | `[friend]`

friend class pqxx::result`[friend]`

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

- result.hxx
- result.cxx