import question

Jonathan M Davis jmdavisProg at gmx.com
Sat Jan 21 12:57:47 PST 2012


On Saturday, January 21, 2012 21:22:22 equinox at atw.hu wrote:
> Hi,
> 
> I have an import related questoin..
> 
> I have this:
> 
> module A;
> 
> const c1=4;
> 
> 
> module B;
> 
> import A;
> 
> 
> module C;
> 
> private import B;
> 
> 
> 
> Should not module C see c1? Because it cannot see it. Even if the import
> is not private.

No. imports are private by default There's no point in marking them as 
private. If you want module C to see what module B is importing, then module B 
needs to import it publicly. e.g.

module B;

public import A;

- Jonathan M Davis


More information about the Digitalmars-d mailing list