ostreambuf_iterator::operator++

返回ostream迭代器到同一字符它的不运行的增量运算符解决的,则操作调用之前。

ostreambuf_iterator<CharType, Traits>& operator++( );
ostreambuf_iterator<CharType, Traits>& operator++( int );

返回值

对最初解决的字符或对转换成 ostreambuf_iterator<CharTypeTraits>的实现中定义的对象。

备注

运算符用于实现该输出迭代器表达式*i = x。

示例

// ostreambuf_iterator_op_incr.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 Class

标准模板库