---
name: "std::iterator"
section: "3"
platform: "linux"
package: "gcc"
version: "16.2.1+r23+gd564253eb6c8-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/std::iterator"
---

# std::iterator(3)

Common iterator class.

## NAME

std::iterator\< \_Category, \_Tp, \_Distance, \_Pointer, \_Reference \> - Common iterator class.

## SYNOPSIS

\#include \<iterator\>

Inherited by **std::reverse\_iterator\< iterator \>**, and **std::reverse\_iterator\< const\_iterator \>**.

### Public Types

typedef \_Distance **difference\_type**\
 Distance between iterators is represented as this type.  typedef \_Category **iterator\_category**\
 One of the **tag types**.  typedef \_Pointer **pointer**\
 This type represents a pointer-to-value\_type.  typedef \_Reference **reference**\
 This type represents a reference-to-value\_type.  typedef \_Tp **value\_type**\
 The type *pointed*to"*by*the*iterator.*

## Detailed Description

### template\<typename \_Category, typename \_Tp, typename \_Distance = ptrdiff\_t, typename \_Pointer = \_Tp\*, typename \_Reference = \_Tp&\>

struct std::iterator\< \_Category, \_Tp, \_Distance, \_Pointer, \_Reference \>"Common iterator class.

This class does nothing but define nested typedefs. Iterator classes can inherit from this class to save some work. The typedefs are then used in specializations and overloading.

In particular, there are no default implementations of requirements such as operator++ and the like. (How could there be?)

## Member Typedef Documentation

### template\<typename \_Category, typename \_Tp, typename \_Distance = ptrdiff\_t, typename \_Pointer = \_Tp\*, typename \_Reference = \_Tp&\> typedef \_Distance std::iterator\< \_Category, \_Tp, \_Distance, \_Pointer, \_Reference \>::difference\_type

Distance between iterators is represented as this type.

### template\<typename \_Category, typename \_Tp, typename \_Distance = ptrdiff\_t, typename \_Pointer = \_Tp\*, typename \_Reference = \_Tp&\> typedef \_Category std::iterator\< \_Category, \_Tp, \_Distance, \_Pointer, \_Reference \>::iterator\_category

One of the **tag types**.

### template\<typename \_Category, typename \_Tp, typename \_Distance = ptrdiff\_t, typename \_Pointer = \_Tp\*, typename \_Reference = \_Tp&\> typedef \_Pointer std::iterator\< \_Category, \_Tp, \_Distance, \_Pointer, \_Reference \>::pointer

This type represents a pointer-to-value\_type.

### template\<typename \_Category, typename \_Tp, typename \_Distance = ptrdiff\_t, typename \_Pointer = \_Tp\*, typename \_Reference = \_Tp&\> typedef \_Reference std::iterator\< \_Category, \_Tp, \_Distance, \_Pointer, \_Reference \>::reference

This type represents a reference-to-value\_type.

### template\<typename \_Category, typename \_Tp, typename \_Distance = ptrdiff\_t, typename \_Pointer = \_Tp\*, typename \_Reference = \_Tp&\> typedef \_Tp std::iterator\< \_Category, \_Tp, \_Distance, \_Pointer, \_Reference \>::value\_type

The type "pointed to" by the iterator.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
