// Fichier genere avec ./genere B #include "B.h" //-- B::B(int a, int b) : A(a), _b(b) { } //-- B::B(const B& aB) : A(aB) { _copy(aB); } //-- B& B::operator=(const B& aB) { if (this != &aB) { A::operator=(aB); _destroy(); _copy(aB); } return *this; } //-- B::~B(void) { _destroy(); } //-- bool operator==(const B& aB1, const B& aB2) { return aB1.isEqualTo(aB2); } //-- bool operator!=(const B& aB1, const B& aB2) { return !(aB1==aB2); } //-- ostream& operator<<(ostream& os, const B& aB) { aB.display(os); return os; } //-- void B::display(ostream& os) const { A::display(os); os << "B::[" << _b << "]"; } //-- bool B::isEqualTo(const B& aB) const { if (_b != aB._b) return false; if (!(A::isEqualTo(aB))) return false; return true; } //-- void B::_copy(const B& aB) { _b = aB._b; } //-- void B::_destroy(void) { }