There already were some pure virtual methods so the task was fulfilled
in ex01 already. It maybe should not have been.
For the evaluator of ex01: The Animal may not be abstract by removing
the pure virtual methods. The methods then have to be called from main
through dynamic_casting the Animal pointers to the Derived pointer
types, which have the methods defined.
return (*this);
}
-// This would better be purely virtual function but the subject mandates that
-// even the base must implement this function.
void Animal::makeSound() const
{
std::cout << "BASE ANIMAL SOUNDS\n";
virtual Animal &operator=(const Animal &other);
- virtual void makeSound() const;
std::string getType() const;
+ virtual void makeSound() const = 0;
virtual void listIdeas() const = 0;
virtual void addIdea(std::string idea) = 0;
};