On the richness of C++

Sean Kelly sean at invisibleduck.org
Fri Apr 11 16:43:49 PDT 2008


== Quote from Robert Fraser (fraserofthenight at gmail.com)'s article
> Sean Kelly wrote:
> > So for the record.  I do think the overload checking is a good idea--it just needs
> > to be clearly documented somewhere (if it isn't already).  And the 'super' thing
> > makes total sense--there's no instance so 'super' isn't technically valid.
> Aren't "super" calls bound at compile-time?

My guess would be that a "super" call rebinds to the superclass' vtbl.
I don't think it actually does a static lookup and direct function call
if that's what you're suggesting, but it does seem technically possible.
In any case, using "super" here may actually work in this case since the
"new" method is effectively static, but it doesn't seem any more advisable
to use it than you would "this" in the same situation.  It's just bad style,
if nothing else.


Sean



More information about the Digitalmars-d mailing list