Function Hijacking article

Walter Bright newshound1 at digitalmars.com
Thu Oct 18 07:44:11 PDT 2007


Stewart Gordon wrote:
>> http://www.digitalmars.com/d/hijack.html
> 
> <snip>
> 
> "B.vtbl[0] = &B.foo(long);
> B.vtbl[1] = &error;"
> 
> So the compiler generates an override that throws a runtime error?

Yes.

> Does 
> it apply to all overloads, or only where potentially compatible 
> parameter types are involved?

It applies to virtual functions that exist in the vtbl[], but are 
inaccessible via anything typed with the derived class.



More information about the Digitalmars-d-announce mailing list