Namensräume
Varianten
Aktionen

std::ostream_iterator

Aus cppreference.com
< cpp‎ | iterator

 
 
Iterator Bibliothek
Iterator Primitiven
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
Iterator Adaptern
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
Stream-Iteratoren
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
Iterator Operationen
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)
Reichen Zugang
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
Member-Funktionen
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)
 
definiert 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_iterator ist ein Single-Pass-Output-Iterator, die aufeinanderfolgende Objekte vom Typ T schreibt in den std::basic_ostream Objekt, für das es konstruiert wurde, mit operator<<. Optional Trennzeichenfolge an den Ausgabe-Stream nach jedem Schreibvorgang geschrieben. Die Schreiboperation durchgeführt wird, wenn der Iterator (ob oder nicht dereferenziert) zugeordnet ist. Inkrementieren des std::ostream_iterator ist ein no-op .
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.
In einer typischen Implementierung sind die einzigen Daten, die Mitglieder der std::ostream_iterator ein Zeiger auf die zugeordneten std::basic_ostream und einen Zeiger auf das erste Zeichen in der Trennzeichenfolge .
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.
Beim Schreiben Zeichen ist std::ostreambuf_iterator effizienter, da sie den Aufwand für den Bau und zerstören die Wache Objekt einmal pro Charakter verhindert .
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.

Inhaltsverzeichnis

[Bearbeiten] Mitglied Typen

Mitglied Typ
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>

[Bearbeiten] Member-Funktionen

baut eine neue 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.

(öffentliche Elementfunktion)
zerstört sich eine 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.

(öffentliche Elementfunktion)
schreibt ein Objekt an den zugehörigen Ausgang Sequenz
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.

(öffentliche Elementfunktion)
no-op
(öffentliche Elementfunktion)
no-op
(öffentliche Elementfunktion)

Inherited from std::iterator

Member types

Mitglied Typ
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

[Bearbeiten] Beispiel

#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

[Bearbeiten] Siehe auch

Ausgabeiterator, die std::basic_streambuf schreibt
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.

(Klassen-Template) [edit]
Input-Iterator, die aus std::basic_istream liest
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.

(Klassen-Template) [edit]