operator<<<div class="t-tr-text">(Std :: basic_ostream)<div class="t-tr-dropdown"><div><div><div class="t-tr-dropdown-arrow-border"></div><div class="t-tr-dropdown-arrow"></div><div class="t-tr-dropdown-h">Original:</div><div class="t-tr-dropdown-orig">(std::basic_ostream)</div><div class="t-tr-dropdown-notes">The text has been machine-translated via [http://translate.google.com Google Translate].<br/> You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.</div></div></div></div></div>
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. |
<metanoindex/>
<tbody> </tbody> template< class CharT, class Traits> basic_ostream<CharT,Traits>& operator<<( basic_ostream<CharT,Traits>& os, CharT ch ); template< class CharT, class Traits> basic_ostream<CharT,Traits>& operator<<( basic_ostream<CharT,Traits>& os, char ch ); template< class Traits > basic_ostream<char,Traits>& operator<<( basic_ostream<char,Traits>& os, char ch ); template< class Traits > basic_ostream<char,Traits>& operator<<( basic_ostream<char,Traits>& os, signed char ch ); template< class Traits > basic_ostream<char,Traits>& operator<<( basic_ostream<char,Traits>& os, unsigned char ch ); |
(1) | |
template< class CharT, class Traits > basic_ostream<CharT,Traits>& operator<<( basic_ostream<CharT,Traits>& os, const CharT* s ); template< class CharT, class Traits > basic_ostream<CharT,Traits>& operator<<( basic_ostream<CharT,Traits>& os, const char* s ); template< class Traits > basic_ostream<char,Traits>& operator<<( basic_ostream<char,Traits>& os, const char* s ); template< class Traits > basic_ostream<char,Traits>& operator<<( basic_ostream<char,Traits>& os, const signed char* s ); template< class Traits > basic_ostream<char,Traits>& operator<<( basic_ostream<char,traits>& os, const unsigned char* s ); |
(2) | |
template< class CharT, class Traits, class T > basic_ostream< charT, traits >& operator<<( basic_ostream<CharT,Traits>&& os, const T& value ); |
(3) | (seit C++11) |
Fügt ein Zeichen oder eine Zeichenkette .
Original:
Inserts a character or a character string.
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.
1-2)
formatiert sind Output-Funktionen: Sie beginnen die Ausführung durch den Bau ein Objekt vom Typ
sentry, die spült die tie()'d Ausgabepuffer wenn nötig und die Stream-Fehler überprüft. Nach dem Bau, wenn die Wache Objekt kehrt false, geben diese Funktionen, ohne den Versuch keine Ausgabe. Wenn ein Fehler auftritt während der Ausgabe, rufen Sie diese Funktionen setstate(ios_base::failbit). Wenn eine Ausnahme während der Ausgabe ausgelöst wird, dann ios :: badbit gesetzt ist (die Ausnahme unterdrückt sofern exceptions()&badbit) != 0, in welchem Fall es wird erneut ausgelöst)Original:
are formatted output functions: they begin execution by constructing an object of type
sentry, which flushes the tie()'d output buffers if necessary and checks the stream errors. After construction, if the sentry object returns false, these functions return without attempting any output. If an error occurs during output, these functions call setstate(ios_base::failbit). If an exception is thrown during output, then ios::badbit is set (the exception is suppressed unless exceptions()&badbit) != 0, in which case it is rethrown)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.
1)
Fügt ein Zeichen
ch. Wenn der Typ des Zeichen nicht CharT, wird es zunächst mit os.widen(ch) umgewandelt. Padding ist, als ob von Stage 3 von num_put::put() bestimmt. Nach dem Einführen wird width(0) genannt .Original:
Inserts a character
ch. If the type of the character is not CharT, it is first converted with os.widen(ch). Padding is determined as if by Stage 3 of num_put::put(). After insertion, width(0) is called.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.
2)
Fügt aufeinanderfolgende Zeichen aus dem Zeichen-Array, dessen erstes Element wird durch
s hingewiesen .Original:
Inserts successive characters from the character array whose first element is pointed to by
s.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.
- für die erste und dritte Überlastungen (soweit
CharTentspricht dem Typ desch), werden exakttraits::length(s)Zeichen eingefügt .Original:for the first and third overloads (whereCharTmatches the type ofch), exactlytraits::length(s)characters are inserted.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - für die zweite Überladung, genau
std::char_traits<char>::length(s)Zeichen eingefügt .Original:for the second overload, exactlystd::char_traits<char>::length(s)characters are inserted.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - in den letzten zwei Überladungen, genau
traits::length(reinterpret_cast<const char*>(s))eingefügt .Original:for the last two overloads, exactlytraits::length(reinterpret_cast<const char*>(s))are inserted.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Padding ist, als ob von Stage 3 von num_put::put() bestimmt. Alle Zeichen werden erweitert mit
os.widen() vor dem Einsetzen. Nach dem Einführen wird width(0) genannt .Original:
Padding is determined as if by Stage 3 of num_put::put(). All characters are widened using
os.widen() before insertion. After insertion, width(0) is called.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.
3)
Ruft die entsprechende Ausgabe-Operator, da eine rvalue Verweis auf einen Output-Stream-Objekt (entspricht
os << value) .Original:
Calls the appropriate insertion operator, given an rvalue reference to an output stream object (equivalent to
os << value).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.
Parameter
| os | - | Ausgabestrom, um Daten einzufügen
Original: output stream to insert data to The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| ch | - | verweisen auf ein Zeichen eingefügt werden soll
Original: reference to a character to insert The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| s | - | Zeiger auf eine Zeichenkette einzufügen
Original: pointer to a character string to insert The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Rückgabewert
st
Beispiel
#include <iostream>
#include <sstream>
int main()
{
std::cout << "Hello, world" // the const char* overlaod
<< '\n'; // the char overload
std::string s = (std::ostringstream() << 1.2).str(); // rvalue overload
std::cout << s << '\n';
}
Output:
Hello, world
1.2
Siehe auch
Einsätze formatierte Daten Original: inserts formatted data The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (öffentliche Elementfunktion) | |