>>The code is an exact same which makes me wonder why the replication? What is the point of using an overloaded operator at all?
It is not the same. In situations where operator= is appropriate, you are making one of two distinct pre-existing objects like the other such that they would compare equally, provided operator== isn't overloaded to do something stupid. In situations where copy construction is appropriate, you are initializing a new object using another object of the same type, such that both objects will compare equally.



LinkBack URL
About LinkBacks




.
. I would be able to use the destructor to destroy the free store