>>2
That's horrible. waka() from A is made to implement waka() from IWoopaWaka even though it doesn't extend it. Be glad it doesn't work in C++.
The following would work:
#include<iostream>
using namespace std;
class IWoopaWaka {
public:
virtual ~IWoopaWaka() {}
virtual void waka() = 0;
virtual void woopa() = 0;
};
class A : public IWoopaWaka {
public:
virtual ~A() {}
void waka() {
cout << "WakA!";
}
};
class B : public A {
public:
void woopa() {
cout << "Woooopa!";
}
};
int main(int argc, char** argv) {
IWoopaWaka* wapa = new B();
wapa->waka();
wapa->woopa();
delete wapa;
return 0;
}
>>9
When a derived class is deleted through a pointer to a base class with a non-virtual destructor, the results are undefined. In practice, if the class doesn't contain any data members, whether it's virtual or not typically doesn't matter, but any C++ programmer should know that you shouldn't rely on undefined behaviour.
>>17
C++ has a few kinks, but nothing described here. The problem here is incompetent programmers.