assignment operator overloading in c++

前端 未结 6 1941
醉梦人生
醉梦人生 2021-02-01 15:07

I have used the following code for assignment operator overloading:

SimpleCircle SimpleCircle::operator=(const SimpleCircle & rhs)
{
     if(this == &rhs         


        
6条回答
  •  猫巷女王i
    2021-02-01 15:31

    it's right way to use operator overloading now you get your object by reference avoiding value copying.

提交回复
热议问题