ostream_iterator::operator++
작동 하지 않는 증가 연산자는 ostream_iterator 작업을 호출 하기 전에 동일한 개체를 처리 합니다.
ostream_iterator<Type, CharType, Traits>& operator++( );
ostream_iterator<Type, CharType, Traits> operator++( int );
반환 값
참조 하는 ostream_iterator.
설명
이러한 멤버 연산자 모두 반환 *이.
예제
// ostream_iterator_op_incr.cpp
// compile with: /EHsc
#include <iterator>
#include <vector>
#include <iostream>
int main( )
{
using namespace std;
// ostream_iterator for stream cout
// with new line delimiter
ostream_iterator<int> intOut ( cout , "\n" );
// standard iterator interface for writing
// elements to the output stream
cout << "Elements written to output stream:" << endl;
*intOut = 10;
intOut++; // No effect on iterator position
*intOut = 20;
*intOut = 30;
}
요구 사항
헤더: <iterator>
네임 스페이스: std