November 12, 2004 suggestion / request - package access | ||||
---|---|---|---|---|
| ||||
what if we could specify a list of packages that could access the scope? module myLib1.a; class A { package(mylib1, mylib2): this(void* ugglyCtorData){} public: this(){} void that(){} package(mylib1, mylib2) void theOther(){} } Ant |
November 13, 2004 Re: suggestion / request - package access | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ant | "Ant" <Ant_member@pathlink.com> wrote in message news:cn39i7$1ibq$1@digitaldaemon.com... > what if we could specify a list of packages that could access the scope? > > module myLib1.a; > > class A > { > package(mylib1, mylib2): > this(void* ugglyCtorData){} > public: > this(){} > void that(){} > package(mylib1, mylib2) void theOther(){} > } That's starting to look like the C++ 'friend' access morass <g>. All you really need to do is group the packages as sub-packages under an enclosing one. If that still won't cover it, I suggest that the protection specifier really should be 'protected' or 'public' anyway. |
Copyright © 1999-2021 by the D Language Foundation