Hopefully I have something new to add to the argument

James Dennett jdennett at acm.org
Sun Jan 6 22:55:41 PST 2008


Jason House wrote:
> Robert DaSilva wrote:
>> This happen when you overRIDE an overLOADed function, but you don't
>> overRIDE all of the overLOADs.
> 
> That sounds like something very easy to detect at compile-time.  Are there
> practical situations with large ovrload sets where this would be a real
> pain for the programmer?

In general, it's a bad idea to have overloaded virtual functions.
A virtual function is a customization point; having overloads means
that each customization has to be sure to overload them all in a
consistent manner.  Much better to have non-virtual overloads which
forward to a single, general, virtual function.  Then the problem
disappears.  I think that diagnosing overloaded virtuals would be
entirely reasonable.

-- James



More information about the Digitalmars-d mailing list