Assignment Operators in Nonvisual Parts

To ensure that attribute changes are signaled, specify an assignment operator for nonvisual parts with attributes, as follows:

  IAddress& operator= (const IAddress& aIAddress);

The implementation of the IAddress class assignment operator follows:

  IAddress& IAddress::operator= (const IAddress& aIAddress)
  {
    if (this == &aIAddress) {
      return *this;
    } /* endif */
    IStandardNotifier::operator=(aIAddress);
    setStreet(aIAddress.street());
    setCity(aIAddress.city());
    setState(aIAddress.state());
    setZip(aIAddress.zip());
    return *this;
  }

Note the following in the previous example:


Related concepts
Constructors in Nonvisual Parts
Destructors in Nonvisual Parts