Question: How do you set base class members using the assignment operator implementation? If for example someone defines the assignment operator in a derived class like this:

(where both `colour` and `Colour()` are members of the base class - meaning the lines indicated below are illegal)

```
Derived& Derived::operator=(const Derived& rhs) 
{
if (&rhs != this)
{

    Colour(rhs.colour);    // not allowed
        Colour(rhs.Colour());  // not allowed
}
return *this;
}

```

what is the solution? Is there a way of linking operator overloads in the base? Do I do something like...

```
Derived& Derived::operator=(const Derived& rhs) : Base::operator=(rhs)
...?

```

Answer: 
It is done like this : 

```
class B
{
 public:
  B& operator=( const B & other )
  {
    v = other.v;
    return *this;
  }
  int v;
};

class D : public B
{
 public:
  D& operator=( const D & other )
  {
    B::operator=( other );
    return *this;
  }
};

```
I implement the operator= functionality assigning/constructing color in the Base class operator if you want to call the Base operator= from the Derived class use:

```
Base::operator=(rhs)

```

in the Derived class operator=() implementation. The signature you've proposed for Derived operator= isn't valid C++ as far as I know.