>
> That is the case with overriding a non-virtual function - the compiler
> will compile it anyway, and most of the time it will work. That's what
> makes it so eeevil.


I saw today, or last night, someone suggesting a keyword to make
non-virtual override explicit, and error otherwise. Which actually sounded
like a really good idea to me, and also addresses this problem.
I think a combination of not-virtual-by-default, and an explicit
non-virtual override keyword would cover your concern, and also minimise
the use of virtual functions. Sounds perfect to me ;)
Overriding a non-virtual is actually very rare, and probably often
unintended... I really like the idea of a keyword to make this rare use
explicit.


> It seems to me the decision is that of sacrificing a real and common
>> problem
>> case with frequent and tangible evidence, for the feeling that the
>> language is
>> defined to do the 'right' thing?
>>
>
> The right thing should be the default.
>

But I fundamentally disagree your choice is 'right'.. This is obviously
subjective, so I don't think that's a fair assertion.
The problem was obviously not completely defined, and not addressed
entirely.. I think the proposal above sounds like a better solution all
round, it addresses everyones concerns, and adds a nice little safety bonus
for rare non-virtual overriding ;)
But as I've previously said, I understand this can't change now, I've let
it go :P

Reply via email to