名前空間
変種
操作

std::ostream_iterator

提供: cppreference.com
< cpp‎ | iterator

 
 
イテレータライブラリ
イテレータプリミティブ
Original:
Iterator primitives
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
iterator_traits
input_iterator_tag
output_iterator_tag
forward_iterator_tag
bidirectional_iterator_tag
random_access_iterator_tag
iterator
イテレータアダプタ
Original:
Iterator adaptors
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
reverse_iterator
ストリーム反復子
Original:
Stream iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
istream_iterator
ostream_iterator
istreambuf_iterator
ostreambuf_iterator
イテレータ操作
Original:
Iterator operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
advance
distance
prev(C++11)
next(C++11)
アクセスの範囲
Original:
Range access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
begin(C++11)
end(C++11)
 
std::ostream_iterator
メンバ関数
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ostream_iterator::ostream_iterator
ostream_iterator::~ostream_iterator
ostream_iterator::operator=
ostream_iterator::operator*
ostream_iterator::operator++
ostream_iterator::operator++(int)
 
Defined in header <iterator>
template< class T,

          class CharT = char,
          class Traits = std::char_traits<charT>>
class ostream_iterator : public std::iterator<std::output_iterator_tag,

                                              void, void, void, void>
std::ostream_iteratorTを使用して、それを構成しているためstd::basic_ostreamオブジェクトにタイプoperator<<の連続するオブジェクトを書き込む単一パスの出力イテレータです。任意の区切り文字列は、すべての書き込み操作の後に出力ストリームに書き込まれます。イテレータは(間接参照か否かにかかわらず)に割り当てられている場合、書き込み操作が実行されます。 std::ostream_iteratorをインクリメントすると、操作は行われません.
Original:
std::ostream_iterator is a single-pass output iterator that writes successive objects of type T into the std::basic_ostream object for which it was constructed, using operator<<. Optional delimiter string is written to the output stream after every write operation. The write operation is performed when the iterator (whether dereferenced or not) is assigned to. Incrementing the std::ostream_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::ostream_iteratorの唯一のデータメンバは、関連std::basic_ostreamと区切りの文字列の最初の文字へのポインタへのポインタです.
Original:
In a typical implementation, the only data members of std::ostream_iterator are a pointer to the associated std::basic_ostream and a pointer to the first character in the delimiter string.
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は、より効率的である.
Original:
When writing characters, std::ostreambuf_iterator is more efficient, since it avoids the overhead of constructing and destructing the sentry object once per character.
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
ostream_type std::basic_ostream<CharT, Traits>

[編集] メンバ関数

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

(パブリックメンバ関数)
ostream_iteratorを破棄します
Original:
destructs an ostream_iterator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数)
関連する出力配列にオブジェクトが書き込まれます
Original:
writes a object 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
(パブリックメンバ関数)

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 <iostream>
#include <sstream>
#include <iterator>
#include <algorithm>
int main()
{
    std::istringstream str("0.1 0.2 0.3 0.4");
    std::partial_sum( std::istream_iterator<double>(str),
                      std::istream_iterator<double>(),
                      std::ostream_iterator<double>(std::cout, " "));
}

Output:

0.1 0.3 0.6 1

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

std::basic_streambufに書き込みを行う出力イテレータ
Original:
output iterator that writes to 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_istreamから読み取る入力イテレータ
Original:
input iterator that reads from std::basic_istream
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

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