private with module name support

Newbie2019 newbie2019 at gmail.com
Fri Aug 9 01:17:28 UTC 2019


When init a projects, or design encapsulation  type. It is 
frequently feed need to made some target only accept by one 
special module(not package but only module).

With current solution, I has to use package(Player) , this is not 
perfect because people can modify package name to made the 
resource accessible.  This is also not work well for a package.d 
module(not able to access from same folder).

the code look like this:

=======================
module PlayerImplement;

private(Player) void doSomeThing(){

}

=======================
module Player;
import PlayerImplement;
void doKill(){
        doSomeThing();
}

=======================

Is this make any sense ?







More information about the Digitalmars-d mailing list