# stl_iterator.h File Reference

## Detailed Description

This is an internal header file, included by other library headers. You should not attempt to use it directly.

This file implements reverse_iterator, back_insert_iterator, front_insert_iterator, insert_iterator, __normal_iterator, and their supporting functions and overloaded operators.

Definition in file stl_iterator.h.

Go to the source code of this file.

## Namespaces

- namespace __gnu_cxx
- namespace std

## Defines

- #define _ITERATOR_H

## Functions

- template<typename _Container> back_insert_iterator< _Container > back_inserter (_Container &__x)
- template<typename _Container> front_insert_iterator< _Container > front_inserter (_Container &__x)
- template<typename _Container, typename _Iterator> insert_iterator< _Container > inserter (_Container &__x, _Iterator __i)
- template<typename _Iterator, typename _Container> bool operator!= (const __normal_iterator< _Iterator, _Container > &__lhs, const __normal_iterator< _Iterator, _Container > &__rhs)
- template<typename _IteratorL, typename _IteratorR, typename _Container> bool operator!= (const __normal_iterator< _IteratorL, _Container > &__lhs, const __normal_iterator< _IteratorR, _Container > &__rhs)
- template<typename _Iterator> bool operator!= (const reverse_iterator< _Iterator > &__x, const reverse_iterator< _Iterator > &__y)
- template<typename _Iterator, typename _Container> __normal_iterator< _Iterator,
  _Container > operator+ (typename __normal_iterator< _Iterator, _Container >::difference_type __n, const __normal_iterator< _Iterator, _Container > &__i)
- template<typename _Iterator> reverse_iterator< _Iterator > operator+ (typename reverse_iterator< _Iterator >::difference_type __n, const reverse_iterator< _Iterator > &__x)
- template<typename _IteratorL, typename _IteratorR, typename _Container> __normal_iterator< _IteratorL,
  _Container >::difference_type operator- (const __normal_iterator< _IteratorL, _Container > &__lhs, const __normal_iterator< _IteratorR, _Container > &__rhs)
- template<typename _Iterator> reverse_iterator< _Iterator
  >::difference_type operator- (const reverse_iterator< _Iterator > &__x, const reverse_iterator< _Iterator > &__y)
- template<typename _Iterator, typename _Container> bool operator< (const __normal_iterator< _Iterator, _Container > &__lhs, const __normal_iterator< _Iterator, _Container > &__rhs)
- template<typename _IteratorL, typename _IteratorR, typename _Container> bool operator< (const __normal_iterator< _IteratorL, _Container > &__lhs, const __normal_iterator< _IteratorR, _Container > &__rhs)
- template<typename _Iterator> bool operator< (const reverse_iterator< _Iterator > &__x, const reverse_iterator< _Iterator > &__y)
- template<typename _Iterator, typename _Container> bool operator<= (const __normal_iterator< _Iterator, _Container > &__lhs, const __normal_iterator< _Iterator, _Container > &__rhs)
- template<typename _IteratorL, typename _IteratorR, typename _Container> bool operator<= (const __normal_iterator< _IteratorL, _Container > &__lhs, const __normal_iterator< _IteratorR, _Container > &__rhs)
- template<typename _Iterator> bool operator<= (const reverse_iterator< _Iterator > &__x, const reverse_iterator< _Iterator > &__y)
- template<typename _Iterator, typename _Container> bool operator== (const __normal_iterator< _Iterator, _Container > &__lhs, const __normal_iterator< _Iterator, _Container > &__rhs)
- template<typename _IteratorL, typename _IteratorR, typename _Container> bool operator== (const __normal_iterator< _IteratorL, _Container > &__lhs, const __normal_iterator< _IteratorR, _Container > &__rhs)
- template<typename _Iterator> bool operator== (const reverse_iterator< _Iterator > &__x, const reverse_iterator< _Iterator > &__y)
- template<typename _Iterator, typename _Container> bool operator> (const __normal_iterator< _Iterator, _Container > &__lhs, const __normal_iterator< _Iterator, _Container > &__rhs)
- template<typename _IteratorL, typename _IteratorR, typename _Container> bool operator> (const __normal_iterator< _IteratorL, _Container > &__lhs, const __normal_iterator< _IteratorR, _Container > &__rhs)
- template<typename _Iterator> bool operator> (const reverse_iterator< _Iterator > &__x, const reverse_iterator< _Iterator > &__y)
- template<typename _Iterator, typename _Container> bool operator>= (const __normal_iterator< _Iterator, _Container > &__lhs, const __normal_iterator< _Iterator, _Container > &__rhs)
- template<typename _IteratorL, typename _IteratorR, typename _Container> bool operator>= (const __normal_iterator< _IteratorL, _Container > &__lhs, const __normal_iterator< _IteratorR, _Container > &__rhs)
- template<typename _Iterator> bool operator>= (const reverse_iterator< _Iterator > &__x, const reverse_iterator< _Iterator > &__y)

## Function Documentation

back_insert_iterator<_Container> std::back_inserter | ( | _Container & | __x | ) | `[inline]`

Parameters:

  | x | A container of arbitrary type.

Returns:
  An instance of back_insert_iterator working on `x`.

This wrapper function helps in creating back_insert_iterator instances. Typing the name of the iterator requires knowing the precise full type of the container, which can be tedious and impedes generic programming. Using this function lets you take advantage of automatic template parameter deduction, making the compiler match the correct types for you.

Definition at line 397 of file stl_iterator.h.

front_insert_iterator<_Container> std::front_inserter | ( | _Container & | __x | ) | `[inline]`

Parameters:

  | x | A container of arbitrary type.

Returns:
  An instance of front_insert_iterator working on `x`.

This wrapper function helps in creating front_insert_iterator instances. Typing the name of the iterator requires knowing the precise full type of the container, which can be tedious and impedes generic programming. Using this function lets you take advantage of automatic template parameter deduction, making the compiler match the correct types for you.

Definition at line 471 of file stl_iterator.h.

insert_iterator<_Container> std::inserter | ( | _Container & | __x,
|  | _Iterator | __i
| ) | `[inline]`

Parameters:

  | x | A container of arbitrary type.

Returns:
  An instance of insert_iterator working on `x`.

This wrapper function helps in creating insert_iterator instances. Typing the name of the iterator requires knowing the precise full type of the container, which can be tedious and impedes generic programming. Using this function lets you take advantage of automatic template parameter deduction, making the compiler match the correct types for you.

Definition at line 567 of file stl_iterator.h.

bool std::operator== | ( | const reverse_iterator< _Iterator > & | __x,
|  | const reverse_iterator< _Iterator > & | __y
| ) | `[inline]`

Parameters:

  | x | A reverse_iterator.
  | y | A reverse_iterator.

Returns:
  A simple bool.

Reverse iterators forward many operations to their underlying base() iterators. Others are implemented in terms of one another.

Definition at line 277 of file stl_iterator.h.

References reverse_iterator::base().