Overloading Assignment Operator Writing College Essays Yourself
The problem here is that if you’re trying to transactionize the assignment, so that either all of it happens or none of it happens, this breaks that.
If an exception occurs trying to new up might succeed, changing the object, and we only want to change the object if we can carry out the whole assignment operation.
Technically they’re right, but I’d strongly counsel against letting this happen.
operator can be defined, and then it will be used instead when the compiler encounters a typecast.
The reverse is not true: In a regular assignment, the compiler will not consider explicit assignment operators.
The assignment-operator article drew a huge response, with a lot of people sending me corrections and disagreements of various kinds.
The issues have been mounting up, so I thought maybe a follow-on article to discuss the issues would be appropriate.