#include class DeepThought { public: int berechnen () { // sleep(years2secs(7500000)); return zahl << 1 ^ zahl << 3 ^ zahl << 5; } protected: int zahl; }; class Antwort { public: virtual int erfragen() { return 0; } virtual ~Antwort() = default; }; class EinfacheAntwort : public Antwort { int erfragen() override { return 42; } } class UltimativeAntwort : public Antwort, private DeepThought { // Interface Implementation public: int erfragen() final { zahl = 1; return berechnen(); } }; class WirklichLetzteAntwort final : public UltimativeAntwort {}; int main() { Antwort* antwort = new WirklichLetzteAntwort(); std::cout << antwort->erfragen() << '\n'; delete antwort; }