All built-in assignment operators return *this, and most user-defined overloads also return *this so that the user-defined operators can be used in the same manner as the built-ins. However, in a user-defined operator overload, any type can be used as return type (including void).

The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.

T2 pode ser de qualquer tipo, incluindo T

Original:

T2 can be any type including T

The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.

copy assignment operator replaces the contents of the object a with a copy of the contents of b (b is no modified). For class types, this is a special member function, described in copiar operador de atribuição.

The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.

move assignment operator replaces the contents of the object a with the contents of b, avoiding copying if possible (b may be modified). For class types, this is a special member function, described in mover operador de atribuição. (a partir do C++ 11)

The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.

The direct assignment operator expects a modifiable lvalue as its left operand and returns an lvalue identifying the left operand after modification. For non-class types, the right operand is first convertidos implicitamente to the cv-unqualified type of the left operand, and then its value is copied into the object identified by left operand.

The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.