How can I explicitly qualify things from module?

Jonathan M Davis jmdavisProg at gmx.com
Sun Dec 22 12:04:33 PST 2013


On Sunday, December 22, 2013 19:23:49 Cpluspluser wrote:
> Hello everybody.
> 
> In C++ it is considered good practice to qualify names in
> namespaces, as in:
> 
> std::vector<int> v;
> std::cout << std::endl;
> 
> How can this be done in D, with its std module?
> For example I tried the following and it doesn't work.
> 
> import std.stdio;
> 
> void main()
> {
>      std.writeln("Hello world!");
> }
> 
> Thank you for your time.

You have to give the full module path:

std.stdio.writeln

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list