名前空間
変種
操作

std::ostreambuf_iterator

提供: cppreference.com
< cpp‎ | iterator

Defined in header <iterator>
template< class CharT, class Traits = std::char_traits<CharT>>

class ostreambuf_iterator : public std::iterator<std::output_iterator_tag,

                                                 void, void, void, void>
std::ostreambuf_iteratorそれを構成しているためstd::basic_streambufオブジェクトに連続した文字を書き込み、単一パスの出力イテレータです。イテレータは(間接参照か否かにかかわらず)に割り当てられたときに実際の書き込み動作が実行されます。 std::ostreambuf_iteratorをインクリメントすると、操作は行われません.
Original:
std::ostreambuf_iterator is a single-pass output iterator that writes successive characters into the std::basic_streambuf object for which it was constructed. The actual write operation is performed when the iterator (whether dereferenced or not) is assigned to. Incrementing the std::ostreambuf_iterator is a no-op.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
典型的な実装では、std::ostreambuf_iteratorの唯一のデータメンバは、関連std::basic_streambufとファイル状態の終わりに達したかどうかを示すbooleanフラグへのポインタです.
Original:
In a typical implementation, the only data members of std::ostreambuf_iterator are a pointer to the associated std::basic_streambuf and a boolean flag indicating if the the end of file condition has been reached.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] メンバータイプ

メンバー·タイプ
Original:
Member type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
char_type CharT
traits_type Traits
streambuf_type std::basic_streambuf<CharT, Traits>
ostream_type std::basic_ostream<CharT, Traits>

[編集] メンバ関数

新しいostreambuf_iteratorを構築します
Original:
constructs a new ostreambuf_iterator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数)
(destructor)
(暗黙的に宣言された)
destructs an ostreambuf_iterator
(パブリックメンバ関数)
関連する出力配列に文字が書き込まれます
Original:
writes a character to the associated output sequence
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数)
no-op
(パブリックメンバ関数)
no-op
(パブリックメンバ関数)
IF出力のテストが失敗しました
Original:
tests if output failed
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数)

Inherited from std::iterator

Member types

メンバー·タイプ
Original:
Member type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
value_type void
difference_type void
pointer void
reference void
iterator_category std::output_iterator_tag

[編集]

#include <string>
#include <algorithm>
#include <iterator>
#include <iostream>
int main()
{
    std::string s = "This is an example\n";
    std::copy(s.begin(), s.end(), std::ostreambuf_iterator<char>(std::cout));
}

出力:

This is an example

[編集] も参照してください

std::basic_streambufから読み取る入力イテレータ
Original:
input iterator that reads from std::basic_streambuf
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(クラステンプレート) [edit]
std::basic_ostreamに書き込みを行う出力イテレータ
Original:
output iterator that writes to std::basic_ostream
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(クラステンプレート) [edit]