Can somebody please explain to me what this method / function is doing?
Bank& Bank::operator=(const Bank& bank) throw() {
// Zuweisung auf mich selbst?
if (this == &bank)
return *this;
// bisherige Konto-Objekte destruieren
loescheKonten();
// Attribute uebertragen und das Array anlegen
this->name = bank.name;
this->maxAnzKonten = bank.maxAnzKonten;
kontoTab = new Konto*[maxAnzKonten];
anzKonten = bank.anzKonten;
// vorhandene Konten kopieren
for (int i = 0; i < anzKonten; i++) {
Konto* tmp = bank.kontoTab[i];
kontoTab[i] = new Konto(*tmp);
}
return *this;
}
especially this :
Bank& Bank::operator=(const Bank& bank) throw() {
// Zuweisung auf mich selbst?
if (this == &bank)
return *this;
what means Bank::operator=(const Bank& bank) ...
Bank constructor assigns the Bank class bank to the operator variable? or how? and operator is of type Bank?