samedi 7 mars 2015

implicit assignment operators [C++]


if i have an operator overload on my class, is the assignment version of the operator implicitly created as well?



class square{
square& operator+(const square& B);
void operator=(const square& B);
};


As in, can I then call



square A, B;
A += B;


with the compiler implicitly deciding to call 'operator+' then 'operator=' ?




Aucun commentaire:

Enregistrer un commentaire