www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Protection attributes and aliases

Protection attributes should apply to aliases and they shouldn't be  
inherited from the item it's aliasing.

private int _foo;
alias _foo foo; // Should be public.

int _bar;
private _bar bar; // Should be private.


Just like deprecated can apply to an alias.

There are good uses for this, and I even have a pretty cool usage idea.


By the way, on www.digitalmars.com/d/attribute.html under "Protection  
Attribute" it says "Protection is an attribute that is one of private,  
package, protected, public or export.". I don't really see export as  
fitting in that list, even though the way it's worded ("Export means that  
any code outside the executable can access the member.") sounds  
convincing. deprecated probably belongs in that list more than export does.
Feb 14 2006