selective import

Alexandr Druzhinin drug2004 at bk.ru
Thu Dec 5 03:17:17 PST 2013


Hi all.
How to use use selective imports more effectively? I have two modules 
foo and bar:

module foo;

class Foo {}

module bar;

import foo: Foo;

class Bar
{
	private Foo foo_;
	this(Foo foo)
	{
		foo_ = foo;
	}
}

Now I add module baz that use both modules above. How to import foo and 
bar - everything or only 'the topmost' one, bar?

module baz;

import bar: Bar;
import foo: Foo;

or

import bar: Bar, Foo; // also in bar import of foo.Foo should be public 
of course

I don't see difference, but it doesn't mean it doesn't exist. What do 
you think about it?


More information about the Digitalmars-d-learn mailing list