Lukas Jiriste [Fri, 25 Oct 2024 11:08:40 +0000 (13:08 +0200)]
Make some Animal methods pure virtual
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.
Lukas Jiriste [Fri, 25 Oct 2024 11:00:04 +0000 (13:00 +0200)]
Change Makefile to invoke g++ -MM for dependencies
The g++ -MM $(SOURCES) creates dependency list (without system deps) for
all the sources in a format suitable for Makefile.
I don't like using g++ just after making use of clang++ explicit as I
don't know whether both of those are usually present on PCs.
The solution would probably be to provide the g++ incompatible flag
conditionally when c++ == clang++.
Lukas Jiriste [Fri, 25 Oct 2024 10:36:19 +0000 (12:36 +0200)]
Add flag to Makefile
The 42 computers have c++ pointed to clang++. Clang obscures the
std::string type in gdb even with -g flag, but the option
-fno-limit-debug-info makes std::string legible.
So I added he flag but it is not used in g++ which could be hiding under
c++, so I've rewritten the Makefile to explicitly use clang++.
Lukas Jiriste [Fri, 25 Oct 2024 07:28:53 +0000 (09:28 +0200)]
Extend main.cpp, make Animal destr virtual in ex00
Extend main.cpp by the Wrong- classes and add delete to call the
destructors. For the delete to work properly, the Animal destructor is
changed to a virtual one.