Here some stuff which I did in Visual Studio 2005 and CodeWarrior.
So, it's definitelly not a jsut compiler bug.
I defined class like this:
So, I have pure virtual method.Code:class A { public: virtual void B() = 0; };
Sure thing, we can't instantiate class.
However, what I found I can add implementation for pure virtual method (which doesn't make any sense)
And compiler won't say me a damn thing.Code:void A::B() { printf("z"); }
I can't instantiate it still.
However, I can do this:
First of all I was able to compile this, where I can pure abstract method.Code:class C: public A { public: virtual void B(); }; void C::B() { A::B(); }
Second, I was able to debug it and step into A::B.
It's definitelly crazy.
Does anybody have explanation, why it works?



LinkBack URL
About LinkBacks


