std::ostreambuf_iterator
Aus cppreference.com
![]() |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
definiert in Header <iterator>
|
||
template< class CharT, class Traits = std::char_traits<CharT>> class ostreambuf_iterator : public std::iterator<std::output_iterator_tag, |
||
std::ostreambuf_iterator
ist ein Single-Pass-Output-Iterator, die aufeinanderfolgende Zeichen schreibt in den std::basic_streambuf Objekt, für das es konstruiert wurde. Die tatsächliche Schreiboperation durchgeführt wird, wenn der Iterator (ob oder nicht dereferenziert) zugeordnet ist. Inkrementieren des std::ostreambuf_iterator
ist ein no-op .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.
You can help to correct and verify the translation. Click here for instructions.
In einer typischen Implementierung sind die einzigen Daten Mitgliedern
std::ostreambuf_iterator
ein Zeiger auf den zugehörigen std::basic_streambuf
und einem boolean Flag, das anzeigt, wenn das das Ende der Datei erreicht worden ist .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.
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
|
streambuf_type
|
std::basic_streambuf<CharT, Traits> |
ostream_type
|
std::basic_ostream<CharT, Traits> |
[Bearbeiten] Member-Funktionen
baut eine neue 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. (öffentliche Elementfunktion) | |
(destructor) (implizit deklariert) |
destructs an ostreambuf_iterator (öffentliche Elementfunktion) |
Schreibt ein Zeichen in der zugehörigen Ausgangs-Sequenz 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. (öffentliche Elementfunktion) | |
no-op (öffentliche Elementfunktion) | |
no-op (öffentliche Elementfunktion) | |
Tests, wenn der Ausgang nicht 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. (ö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 <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)); }
Output:
This is an example
[Bearbeiten] Siehe auch
Input-Iterator, die aus std::basic_streambuf liest 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. (Klassen-Template) | |
Ausgabeiterator, die std::basic_ostream schreibt 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. (Klassen-Template) |