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>
![]() |
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. |
template< class CharT, class Traits> basic_ostream<CharT,Traits>& operator<<( basic_ostream<CharT,Traits>& os, |
(1) | |
template< class CharT, class Traits > basic_ostream<CharT,Traits>& operator<<( basic_ostream<CharT,Traits>& os, |
(2) | |
template< class CharT, class Traits, class T > basic_ostream< charT, traits >& operator<<( basic_ostream<CharT,Traits>&& os, |
(3) | (dal C++11) |
You can help to correct and verify the translation. Click here for instructions.
sentry
, che svuota il buffer di uscita tie()'d, se necessario, e controlla gli errori del flusso. Dopo la costruzione, se i rendimenti sentinella oggetto false, queste funzioni restituiscono senza tentare alcun output. Se si verifica un errore durante l'uscita, queste funzioni setstate(ios_base::failbit) chiamare. Se viene generata un'eccezione durante l'uscita, poi ios :: badbit è impostato (l'eccezione è soppressa a meno exceptions()&badbit) != 0, nel qual caso viene rilanciata)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)You can help to correct and verify the translation. Click here for instructions.
ch
. Se il tipo di carattere non è CharT
, viene prima convertito con os.widen(ch). Riempimento è determinato come per la fase 3 di num_put::put(). Dopo l'inserimento, width(0) è chiamato.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.You can help to correct and verify the translation. Click here for instructions.
s
.s
.You can help to correct and verify the translation. Click here for instructions.
- per i sovraccarichi primo e il terzo (dove
CharT
corrisponda al tipo dich
), esattamentetraits::length(s)
caratteri vengono inseriti.Original:for the first and third overloads (whereCharT
matches 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. - per il secondo overload, esattamente std::char_traits<char>::length(s) caratteri vengono inseriti.Original:for the second overload, exactly std::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. - per gli ultimi due overload, esattamente traits::length(reinterpret_cast<const char*>(s)) sono inseriti.Original:for the last two overloads, exactly traits::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.
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] Parametri
os | - | uscita del flusso di inserire i dati
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 | - | riferimento a un carattere da inserire
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 | - | puntatore a una stringa di caratteri da inserire
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. |
[modifica] Valore di ritorno
st
[modifica] Esempio
#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
[modifica] Vedi anche
inserisce i dati formattati 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. (metodo pubblico) |