Rogue Wave banner
Previous fileTop of documentContentsIndexNext file

istreambuf_iterator


istreambuf_iteratorinherits frominput_iterator

Summary

Reads successive characters from the stream buffer for which it was constructed.

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Synopsis

#include <streambuf> 
template<class charT, class traits = char_traits<charT> >
class istreambuf_iterator
: public input_iterator

Description

The template class istreambuf_iterator reads successive characters from the stream buffer for which it was constructed. operator* gives access to the current input character, if any, and operator++ advances to the next input character. If the end of stream is reached, the iterator becomes equal to the end of stream iterator value, which is constructed by the default constructor, istreambuf_iterator(). An istreambuf_iterator object can be used only for one-pass-algorithms.

Interface

Types

char_type
int_type
istream_type
streambuf_type
traits_type

Nested Class Proxy

Class istreambuf_iterator<charT,traits>::proxy is a temporary placeholder for the return value of the post-increment operator. It keeps the character pointed to by the previous value of the iterator for some possible future access.

Constructors

istreambuf_iterator()
  throw();
istreambuf_iterator(istream_type& s) 
  throw();
istreambuf_iterator(streambuf_type *s) 
  throw();
istreambuf_iterator(const proxy& p) 
  throw();

Member Operators

char_type 
operator*();
istreambuf_iterator<charT, traits>& 
operator++();
proxy 
operator++(int); 

Public Member Functions

bool 
equal(istreambuf_iterator<charT, traits>& b); 

Non-member Functions

template<class charT, class traits>
bool 
operator==(istreambuf_iterator<charT, traits>& a,
                istreambuf_iterator<charT, traits>& b); 
template<class charT, class traits>
bool 
operator==(istreambuf_iterator<charT, traits>& a,
                istreambuf_iterator<charT, traits>& b); 

Example

See Also

basic_streambuf(3C++), basic_istream(3C++), ostreambuf_iterator(3C++)

Working Paper for Draft Proposed International Standard for Information Systems--Programming Language C++, Section 24.5.3

Standards Conformance

ANSI X3J16/ISO WG21 Joint C++ Committee



Previous fileTop of documentContentsIndexNext file
©Copyright 1998, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.
OEM Release, June 1998