When does final mean "maybe, kinda, sorta" ?

Sean Kelly sean at f4.ca
Tue Jan 23 00:06:08 PST 2007


kris wrote:
> Andrei Alexandrescu (See Website For Email) wrote:
>> kris wrote:
>> [snip]
>> I agree about the misleading part, but I don't think that overriding 
>> private methods is poor practice. In fact I think it's rich practice 
>> :o). See e.g. http://www.gotw.ca/publications/mill18.htm.
>>
>> Andrei
> 
> Design philosophy aside, what should be done about the issues with 
> "final" itself?

I think the current design is consistent but potentially confusing.  If 
a function can be virtual (ie. if it is not private) then "final" 
controls whether it can be overridden.  So making a private function 
final is meaningless because it cannot be overridden--in this case, 
"final" is simply ignored.


Sean



More information about the Digitalmars-d mailing list