std::basic_stringbuf::operator=
Aus cppreference.com
< cpp | io | basic stringbuf
![]() |
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. |
std::basic_stringbuf& operator=( std::basic_stringbuf&& rhs ); |
(seit C++11) | |
std::basic_stringbuf& operator=( const std::basic_stringbuf& rhs ) = delete; |
||
1)
Bewegen Zuweisungsoperator: Verschiebt den Inhalt der
rhs
in *this
. Nach dem Umzug hat lhs
die zugehörige Saite, die offenen Modus, das Gebietsschema, und alle anderen staatlichen früher rhs
statt. Die sechs Zeiger std::basic_streambuf in lhs
sind garantiert unterschiedlich von den entsprechenden Zeigern in der eingefahrenen aus rhs
sofern null .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)
Der Zuweisungsoperator wird gestrichen;
basic_stringbuf
nicht 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.
Inhaltsverzeichnis |
[Bearbeiten] Parameter
rhs | - | anderen
basic_stringbuf Das wird von verschoben werdenOriginal: 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. |
[Bearbeiten] Rückgabewert
*this
[Bearbeiten] Beispiel
#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 = ""
[Bearbeiten] Siehe auch
konstruiert eine basic_stringbuf Objekt 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. (öffentliche Elementfunktion) |