std::basic_stringbuf::operator=
Da cppreference.com.
< cpp | io | basic stringbuf
![]() | 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_stringbuf& operator=(std::basic_stringbuf&& rhs ); | (dal C++11) | |
std::basic_stringbuf& operator=(conststd::basic_stringbuf& rhs )= delete; | ||
1)
Spostare operatore di assegnazione: sposta il contenuto di
rhs
in *this
. Dopo lo spostamento, lhs
ha la stringa associata, la modalità di apertura, il locale, e tutto altro stato in precedenza detenuto da rhs
. I sei indicatori di std::basic_streambuf in lhs
sono garantiti per essere diversi dai puntatori corrispondenti nel mosso-da rhs
a meno che nulla.Original:
Move assignment operator: Moves the contents of
rhs
into *this
. After the move, lhs
has the associated string, the open mode, the locale, and all other state formerly held by rhs
. The six pointers of std::basic_streambuf in lhs
are guaranteed to be different from the corresponding pointers in the moved-from rhs
unless null.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)
L'operatore di assegnamento per copia è soppresso;
basic_stringbuf
non è CopyAssignable
.Original:
The copy assignment operator is deleted;
basic_stringbuf
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_stringbuf che verrà spostato daOriginal: another basic_stringbuf 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 <sstream>#include <string>#include <iostream> int main(){ std::istringstream one("one");std::ostringstream two("two"); std::cout<<"Before move, one = \""<< one.str()<<'"'<<" two = \""<< two.str()<<"\"\n"; *one.rdbuf()=std::move(*two.rdbuf()); std::cout<<"Before move, one = \""<< one.str()<<'"'<<" two = \""<< two.str()<<"\"\n";}
Output:
Before move, one = "one" two = "two" Before move, one = "two" two = ""
[modifica]Vedi anche
costruisce un oggetto basic_stringbuf Original: constructs a basic_stringbuf 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) |