The impoliteness of overriding methods

Benjamin Thaut code at benjamin-thaut.de
Thu Dec 20 12:58:40 PST 2012


Am 20.12.2012 20:12, schrieb foobar:>
 > This argument is false.
 >
 > With the current "usual" design:
 > Base instance = new Derived();
 > instance.method(); // #1
 >
 > With Beta design:
 > Base instance = new Derived();
 > instance.method(); // #2
 >
 > In case #1, the call to method itself is virtual while the call to super
 > is not, whereas in case #2 the call to method is _not_ virtual, but the
 > call to inner is virtual. Either way you get one virtual call. The
 > difference is the direction of the calls.

No its not, if you have a chain that is longer than just 1 you will have 
more virtual calls in the inner case.

Kind Regards
Benjamin Thaut


More information about the Digitalmars-d mailing list