Shouldn't private methods be virtual too?

Robert Fraser fraserofthenight at gmail.com
Tue Jun 10 20:09:37 PDT 2008


Jarrett Billingsley wrote:
> "Robert Fraser" <fraserofthenight at gmail.com> wrote in message 
> news:g2n15d$2jo8$1 at digitalmars.com...
>> I agree, but last time I asked this it seemed like an unwinnable battle 
>> (everyone else said private should imply "final"). More controversial was 
>> whether "package" should imply "final" (which it does now, but I think it 
>> should not).
> 
> I'll agree with you on "package".  "package" should be entirely a visibility 
> attribute.  More or less it would function like 'protected' as long as the 
> deriving class were in the same package; and 'private' if it weren't.  Sigh. 

"protected" and "package" are non-equivalent overlapping sets; neither 
one a subset of the other. "package" means anything in the package can 
access it, whether it's in a derived class or not. "protected" means 
that only thing in the derived class (or the same module as the item in 
question) should be able to access it, no matter what package they're in.



More information about the Digitalmars-d mailing list