Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Either returns the next character from the input stream or copies the object before incrementing it and returns the copy.
istreambuf_iterator<CharType, Traits>& operator++( );
istreambuf_iterator<CharType, Traits> operator++( int );
Return Value
An istreambuf_iterator or a reference to an istreambuf_iterator.
Remarks
The first operator eventually attempts to extract and store an object of type CharType from the associated input stream. The second operator makes a copy of the object, increments the object, and then returns the copy.
Example
// istreambuf_iterator_operator_incr.cpp
// compile with: /EHsc
#include <iterator>
#include <iostream>
int main( )
{
using namespace std;
cout << "Type string of characters & enter to output it,\n"
<< " with stream buffer iterators,(try: 'I'll be back.')\n"
<< " repeat as many times as desired,\n"
<< " then keystroke ctrl-Z Enter to exit program: ";
istreambuf_iterator<char> inpos ( cin );
istreambuf_iterator<char> endpos;
ostreambuf_iterator<char> outpos ( cout );
while ( inpos != endpos )
{
*outpos = *inpos;
++inpos; //Increment istreambuf_iterator
++outpos;
}
}
I'll be back.
FakePre-ef4e9233133c45ca83a2536c32465364-cbff2b53f7b14d6eaf2fa8b708aa99bb
Requirements
Header: <iterator>
Namespace: std