public aliases to private/package symbols

Nick Sabalausky a at a.a
Wed Jan 25 02:02:09 PST 2012


"Nick Sabalausky" <a at a.a> wrote in message 
news:jfojur$2a7l$1 at digitalmars.com...
> "Sönke Ludwig" <ludwig at informatik.uni-luebeck.de> wrote in message 
> news:jfoh1s$25ce$1 at digitalmars.com...
>> Another example would be synchronized classes:
>>
>> synchronized class X {
>> public alias f g;
>> private void f(){}
>> }
>>
>> Now g() would be a public method that is not protected by the class' 
>> mutex. This case would have to be explicitly forbidden.
>
> Or just cause f to be protected by the class's mutex.

After all, if you're making a public alias of f, then you obviously *do* 
want that function to be public-accessible, just not through the *name* "f".




More information about the Digitalmars-d mailing list