libstdc++: std::istream_iterator< _Tp, _CharT, _Traits, _Dist > Class Template Reference

libstdc++

std::istream_iterator< _Tp, _CharT, _Traits, _Dist > Class Template Reference
Iterators

`#include <stream_iterator.h>`

Inheritance diagram for std::istream_iterator< _Tp, _CharT, _Traits, _Dist >:
[legend]

## Public Types
typedef _CharT | char_type
typedef ptrdiff_t | difference_type
typedef basic_istream< _CharT, _Traits > | istream_type
typedef input_iterator_tag | iterator_category
typedef const _Tp * | pointer
typedef const _Tp & | reference
typedef _Traits | traits_type
typedef _Tp | value_type

## Public Member Functions
constexpr | istream_iterator () noexcept(/*conditional */)
constexpr | istream_iterator (const istream_iterator &__obj) noexcept(/*conditional */)
constexpr | istream_iterator (default_sentinel_t) noexcept(is_nothrow_default_constructible_v< _Tp >)
| istream_iterator (istream_type &__s)
const _Tp & | operator* () const noexcept
istream_iterator & | operator++ ()
istream_iterator | operator++ (int)
const _Tp * | operator-> () const noexcept
istream_iterator & | operator= (const istream_iterator &)=default

## Friends
bool | operator== (const istream_iterator &__i, default_sentinel_t) noexcept
bool | operator== (const istream_iterator &__x, const istream_iterator &__y) noexcept

## Detailed Description

template<typename _Tp, typename _CharT = char, typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>
class std::istream_iterator< _Tp, _CharT, _Traits, _Dist >

Provides input iterator semantics for streams.

Definition at line 58 of file stream_iterator.h.

## Member Typedef Documentation

## ◆ char_type

template<typename _Tp, typename _CharT = char, typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>

typedef _CharT std::istream_iterator< _Tp, _CharT, _Traits, _Dist >::char_type

Definition at line 62 of file stream_iterator.h.

## ◆ difference_type

typedef ptrdiff_t std::iterator< input_iterator_tag, _Tp, ptrdiff_t, const _Tp *, const _Tp & >::difference_type
| inherited

Distance between iterators is represented as this type.

Definition at line 141 of file stl_iterator_base_types.h.

## ◆ istream_type

template<typename _Tp, typename _CharT = char, typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>

typedef basic_istream<_CharT, _Traits> std::istream_iterator< _Tp, _CharT, _Traits, _Dist >::istream_type

Definition at line 64 of file stream_iterator.h.

## ◆ iterator_category

typedef input_iterator_tag std::iterator< input_iterator_tag, _Tp, ptrdiff_t, const _Tp *, const _Tp & >::iterator_category
| inherited

One of the tag types.

Definition at line 137 of file stl_iterator_base_types.h.

## ◆ pointer

typedef const _Tp * std::iterator< input_iterator_tag, _Tp, ptrdiff_t, const _Tp *, const _Tp & >::pointer
| inherited

This type represents a pointer-to-value_type.

Definition at line 143 of file stl_iterator_base_types.h.

## ◆ reference

typedef const _Tp & std::iterator< input_iterator_tag, _Tp, ptrdiff_t, const _Tp *, const _Tp & >::reference
| inherited

This type represents a reference-to-value_type.

Definition at line 145 of file stl_iterator_base_types.h.

## ◆ traits_type

template<typename _Tp, typename _CharT = char, typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>

typedef _Traits std::istream_iterator< _Tp, _CharT, _Traits, _Dist >::traits_type

Definition at line 63 of file stream_iterator.h.

## ◆ value_type

typedef _Tp std::iterator< input_iterator_tag, _Tp, ptrdiff_t, const _Tp *, const _Tp & >::value_type
| inherited

The type "pointed to" by the iterator.

Definition at line 139 of file stl_iterator_base_types.h.

## Constructor & Destructor Documentation

## ◆ istream_iterator() [1/4]

template<typename _Tp, typename _CharT = char, typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>

std::istream_iterator< _Tp, _CharT, _Traits, _Dist >::istream_iterator | ( |  | ) |
| inlineconstexprnoexcept

Construct end of input stream iterator.

Definition at line 76 of file stream_iterator.h.

Referenced by operator==.

## ◆ istream_iterator() [2/4]

template<typename _Tp, typename _CharT = char, typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>

std::istream_iterator< _Tp, _CharT, _Traits, _Dist >::istream_iterator | ( | istream_type & | __s | ) |
| inline

Construct start of input stream iterator.

Definition at line 81 of file stream_iterator.h.

References std::__addressof().

## ◆ istream_iterator() [3/4]

template<typename _Tp, typename _CharT = char, typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>

std::istream_iterator< _Tp, _CharT, _Traits, _Dist >::istream_iterator | ( | const istream_iterator< _Tp, _CharT, _Traits, _Dist > & | __obj | ) |
| inlineconstexprnoexcept

Definition at line 86 of file stream_iterator.h.

## ◆ istream_iterator() [4/4]

template<typename _Tp, typename _CharT = char, typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>

std::istream_iterator< _Tp, _CharT, _Traits, _Dist >::istream_iterator | ( | default_sentinel_t |  | ) |
| inlineconstexprnoexcept

Definition at line 94 of file stream_iterator.h.

## Member Function Documentation

## ◆ operator*()

template<typename _Tp, typename _CharT = char, typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>

const _Tp & std::istream_iterator< _Tp, _CharT, _Traits, _Dist >::operator* | ( |  | ) | const
| inlinenodiscardnoexcept

Definition at line 106 of file stream_iterator.h.

## ◆ operator++() [1/2]

template<typename _Tp, typename _CharT = char, typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>

istream_iterator & std::istream_iterator< _Tp, _CharT, _Traits, _Dist >::operator++ | ( |  | ) |
| inline

Definition at line 120 of file stream_iterator.h.

## ◆ operator++() [2/2]

template<typename _Tp, typename _CharT = char, typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>

istream_iterator std::istream_iterator< _Tp, _CharT, _Traits, _Dist >::operator++ | ( | int |  | ) |
| inline

Definition at line 130 of file stream_iterator.h.

## ◆ operator->()

template<typename _Tp, typename _CharT = char, typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>

const _Tp * std::istream_iterator< _Tp, _CharT, _Traits, _Dist >::operator-> | ( |  | ) | const
| inlinenodiscardnoexcept

Definition at line 116 of file stream_iterator.h.

## Friends And Related Symbol Documentation

## ◆ operator== [1/2]

template<typename _Tp, typename _CharT = char, typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>

bool operator== | ( | const istream_iterator< _Tp, _CharT, _Traits, _Dist > & | __i,
|  | default_sentinel_t | )
| friend

Definition at line 180 of file stream_iterator.h.

## ◆ operator== [2/2]

template<typename _Tp, typename _CharT = char, typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>

bool operator== | ( | const istream_iterator< _Tp, _CharT, _Traits, _Dist > & | __x,
|  | const istream_iterator< _Tp, _CharT, _Traits, _Dist > & | __y )
| friend

Return true if the iterators refer to the same stream, or are both at end-of-stream.

Definition at line 163 of file stream_iterator.h.

References istream_iterator().

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

- stream_iterator.h