다음을 통해 공유


ostreambuf_iterator::operator*

A nonfunctional dereferencing operator used to implement the output iterator expression *i = x.

ostreambuf_iterator<CharType, Traits>& operator*( );

반환 값

The ostreambuf iterator object.

설명

This operator functions only in the output iterator expression *i = x to output characters to stream buffer. Applied to an ostreambuf iterator, it returns the iterator; *iter returns iter,

예제

// ostreambuf_iterator_op_deref.cpp
// compile with: /EHsc
#include <iterator>
#include <vector>
#include <iostream>

int main( )
{
   using namespace std;

   // ostreambuf_iterator for stream cout
   // with new line delimiter
   ostreambuf_iterator<char> charOutBuf ( cout );

   // Standard iterator interface for writing
   // elements to the output stream
   cout << "Elements written to output stream:" << endl;
   *charOutBuf = 'O';
   charOutBuf++;   // no effect on iterator position
   *charOutBuf = 'U';
   *charOutBuf = 'T';
}
  

요구 사항

헤더: <iterator>

네임스페이스: std

참고 항목

참조

ostreambuf_iterator 클래스

표준 템플릿 라이브러리