Private classes?

Oskar Linde oskar.lindeREM at OVEgmail.com
Tue Aug 21 07:09:16 PDT 2007


Regan Heath wrote:

> AFAIK you cannot apply 'private' to a class.

You can and making a class private means it's Ddoc won't be generated, 
so the protection attribute isn't fully ignored. The spec isn't very 
clear on this though. It only says:

"Private module members are equivalent to static declarations in C 
programs."

But since C doesn't have either templates or classes and type 
declarations can not be static in C the spec could be clearer here.

The logical behavior would be that private module members are accessible 
from that module only. Even better if they were visible from that module 
only too. I'd classify it as a compiler bug unless Walter explicitly 
states it is not. :)

-- 
Oskar



More information about the Digitalmars-d mailing list