std::ostreambuf_iterator
Da cppreference.com.
![]() |
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
Elemento definito nell'header <iterator>
|
||
template< class CharT, class Traits = std::char_traits<CharT>> class ostreambuf_iterator : public std::iterator<std::output_iterator_tag, |
||
std::ostreambuf_iterator
è un passaggio singolo iteratore di output che consente di scrivere i caratteri successivi nell'oggetto std::basic_streambuf per cui è stato costruito. L'operazione di scrittura viene eseguito il vero quando l'iteratore (se dereferenced o meno) è assegnato. Incremento del std::ostreambuf_iterator
è un 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 una tipica implementazione, i membri dati unici
std::ostreambuf_iterator
sono un puntatore alla std::basic_streambuf
associato e un flag booleano che indica se la fine del file di condizione è stata raggiunta.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.
Indice |
[modifica] Membri tipi
Membro tipo
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> |
[modifica] Membri funzioni
costruisce un nuovo 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. (metodo pubblico) | |
(destructor) (dichiarato in modo implicito) |
destructs an ostreambuf_iterator (metodo pubblico) |
scrive un carattere la sequenza di output associato 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. (metodo pubblico) | |
no-op (metodo pubblico) | |
no-op (metodo pubblico) | |
test se l'uscita non è riuscita 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. (metodo pubblico) |
Inherited from std::iterator
Member types
Membro tipo
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 |
[modifica] Esempio
#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
[modifica] Vedi anche
iteratore di input che legge da 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. (classe template) | |
uscita iteratore che scrive 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. (classe template) |