Question: I have used the following code for assignment operator overloading:

```
SimpleCircle SimpleCircle::operator=(const SimpleCircle & rhs)
{
     if(this == &rhs)
        return *this;
     itsRadius = rhs.getRadius();
     return *this;
}

```

My Copy Constructor is this:

```
SimpleCircle::SimpleCircle(const SimpleCircle & rhs)
{
    itsRadius = rhs.getRadius();
}

```

In the above operator overloading code, copy constructor is called as there is a new object is being created; hence I used the below code:

```
SimpleCircle & SimpleCircle::operator=(const SimpleCircle & rhs)
{
    if(this == &rhs)
       return *this;
    itsRadius = rhs.getRadius();
    return *this;
}

```

Its working perfectly and the copy constructor problem is avoided, but is there any unknown issues (to me) regarding this ?

Answer: 
There are no problems with the second version of the assignment operator. In fact, that is the standard way for an assignment operator.

**Edit**: Note that I am referring to the return type of the assignment operator, not to the implementation itself. As has been pointed out in comments, the implementation itself is another issue. See [here](http://en.wikibooks.org/wiki/More_C++_Idioms/Copy-and-swap).
The second is pretty standard. You often prefer to return a reference from an assignment operator so that statements like `a = b = c;` resolve as expected. I can't think of any cases where I would want to return a copy from assignment.

One thing to note is that if you aren't needing a deep copy it's sometimes considered best to use the implicit copy constructor and assignment operator generated by the compiler than roll your own. Really up to you though ...

**Edit:**

Here's some basic calls:

```
SimpleCircle x; // default constructor
SimpleCircle y(x); // copy constructor
x = y; // assignment operator

```

Now say we had the first version of your assignment operator:

```
SimpleCircle SimpleCircle::operator=(const SimpleCircle & rhs)
{
     if(this == &rhs)
        return *this; // calls copy constructor SimpleCircle(*this)
     itsRadius = rhs.getRadius(); // copy member
     return *this; // calls copy constructor
}

```

It calls the copy constructor and passes a reference to `this` in order to construct the copy to be returned. Now in the second example we avoid the copy by just returning a reference to `this`

```
SimpleCircle & SimpleCircle::operator=(const SimpleCircle & rhs)
{
    if(this == &rhs)
       return *this; // return reference to this (no copy)
    itsRadius = rhs.getRadius(); // copy member
    return *this; // return reference to this (no copy)
}

```