Espaces de noms
Variantes
Affichages
Actions

std::basic_ostream::basic_ostream

De cppreference.com
< cpp‎ | io‎ | basic ostream

 
 
D'entrée / sortie de bibliothèque
I / O manipulateurs
C-style I / O
Tampons
Original:
Buffers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf
basic_filebuf
basic_stringbuf
strstreambuf (obsolète)
Cours d'eau
Original:
Streams
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Abstractions
Original:
Abstractions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ios_base
basic_ios
basic_istream
basic_ostream
basic_iostream
Fichier E / O
Original:
File I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ifstream
basic_ofstream
basic_fstream
Chaîne I / O
Original:
String I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_istringstream
basic_ostringstream
basic_stringstream
Tableau I / O
Original:
Array I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
istrstream (obsolète)
ostrstream (obsolète)
strstream (obsolète)
Types
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
streamoff
streamsize
fpos
Interface catégorie d'erreur
Original:
Error category interface
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
iostream_category (C++11)
io_errc (C++11)
 
std::basic_ostream
Les objets globaux
Original:
Global objects
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Les fonctions membres
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.
basic_ostream::basic_ostream
basic_ostream::~basic_ostream
basic_ostream::operator= (C++11)
Entrée formaté
Original:
Formatted input
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::operator<<
Entrée non formaté
Original:
Unformatted input
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::put
basic_ostream::write
Positionnement
Original:
Positioning
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::tellp
basic_ostream::seekp
Divers
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::flush
basic_ostream::swap (C++11)
Classes de membres
Original:
Member classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ostream::sentry
Tiers fonctions
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
operator<<(std::basic_ostream)
 
explicit basic_ostream( std::basic_streambuf<CharT, Traits>* sb );
(1)
protected:
basic_ostream( const basic_ostream& rhs ) = delete;
(2)
protected:
basic_ostream( basic_ostream&& rhs );
(3) (depuis C++11)
1)
Construit l'objet basic_ostream, en assignant des valeurs initiales pour la classe de base en appelant basic_ios::init(sb) .
Original:
Constructs the basic_ostream object, assigning initial values to the base class by calling basic_ios::init(sb).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
Le constructeur de copie est protégé, et est supprimé. Flux de sortie ne sont pas copiable .
Original:
The copy constructor is protected, and is deleted. Output streams are not copyable.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)
Le constructeur utilise basic_ios<CharT, Traits>::move(rhs) déplacement pour déplacer tous les éléments basic_ios, à l'exception de la rdbuf(), de rhs en *this. Ce constructeur mouvement est protégé: il est appelé par les constructeurs de mobiles se déplacent classes de flux de sortie std::basic_ofstream et std::basic_ostringstream, qui savent correctement déplacer le streambuffer associé .
Original:
The move constructor uses basic_ios<CharT, Traits>::move(rhs) to move all basic_ios members, except for the rdbuf(), from rhs into *this. This move constructor is protected: it is called by the move constructors of movable output stream classes std::basic_ofstream and std::basic_ostringstream, which know how to correctly move the associated streambuffer.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Paramètres

sb -
streambuffer à utiliser en tant que séquence de sortie
Original:
streambuffer to use as output sequence
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rhs -
basic_ostream pour initialiser à partir
Original:
basic_ostream to initialize from
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Exemple

#include <sstream>
#include <utility>
#include <iostream>
int main()
{
//  std::ostream myout(std::cout);              // ERROR: copy ctor is deleted
    std::ostream myout(std::cout.rdbuf());      // OK: shares buffer with cout
//  std::ostream s2(std::move(std::ostringstream() << 7.1));       // ERROR: move constructor
                                                                   // is protected
    std::ostringstream s2(std::move(std::ostringstream() << 7.1)); // OK: move ctor called
                                                                   // through the derived class
    myout << s2.str() << '\n';
}

Résultat :

7.1