d04 ex02 dynamic_cast dans main pour ne pas avoir une metode pure brain dans animal au cas ou en correction...

This commit is contained in:
Hugo LAMY
2022-03-16 12:42:13 +01:00
parent 1bae971027
commit bac6161af8
8 changed files with 16 additions and 12 deletions

View File

@@ -67,6 +67,7 @@ Cat & Cat::operator=( Cat const & rhs ) {
}
// need of a second overload in case "Animal cat" = "Animal cat";
// https://stackoverflow.com/questions/68248198/why-my-virtual-assignment-operator-not-doing-as-intended
/*
Cat & Cat::operator=( Animal const & rhs ) {
Animal::operator=(rhs);
std::cout << COPLIEN_COLOR "Cat (Animal) assignator" RESET "\n";
@@ -74,6 +75,7 @@ Cat & Cat::operator=( Animal const & rhs ) {
*_brain = *(rhs.getBrain());
return *this;
}
*/
/*********************************************
* PUBLIC MEMBER FUNCTIONS