std::basic_filebuf::operator=
Da cppreference.com.
< cpp | io | basic filebuf
![]() | 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. |
std::basic_filebuf& operator=(std::basic_filebuf&& rhs ); | (dal C++11) | |
std::basic_filebuf& operator=(conststd::basic_filebuf& rhs )= delete; | ||
Prima chiama
2) close()
per chiudere il file associato, poi si sposta il contenuto di rhs
in *this
: la put e get buffer, il file associato, il locale, il openMode, la bandiera is_open, e qualsiasi altro stato. Dopo lo spostamento, rhs
non è associato a un file e rhs.is_open()==false.Original:
First calls
close()
to close the associated file, then moves the contents of rhs
into *this
: the put and get buffers, the associated file, the locale, the openmode, the is_open flag, and any other state. After the move, rhs
is not associated with a file and rhs.is_open()==false.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.
L'operatore di assegnamento per copia è soppresso;
basic_filebuf
non è CopyAssignable
.Original:
The copy assignment operator is deleted;
basic_filebuf
is not CopyAssignable
.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]Parametri
rhs | - | un altro basic_filebuf che verrà spostato daOriginal: another basic_filebuf that will be moved fromThe 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
*this
[modifica]Esempio
#include <fstream>#include <string>#include <iostream> int main(){ std::ifstream fin("test.in");// read-onlystd::ofstream fout("test.out");// write-only std::string s; getline(fin, s);std::cout<< s <<'\n';// output *fin.rdbuf()=std::move(*fout.rdbuf()); getline(fin, s);std::cout<< s <<'\n';// empty line std::cout<<std::boolalpha<< fout.is_open()<<'\n';// prints "false" }
[modifica]Vedi anche
costruisce un oggetto basic_filebuf Original: constructs a basic_filebuf object The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (metodo pubblico) | |
(C++11) | swap due oggetti basic_filebuf Original: swaps two basic_filebuf objects The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (metodo pubblico) |