static import (v2.071.0)

Daniel Kozak via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed May 11 07:50:03 PDT 2016


Dne středa 11. května 2016 16:32:18 CEST, Chris via Digitalmars-d-learn  
napsal(a):

> On Wednesday, 11 May 2016 at 14:28:00 UTC, Vladimir Panteleev wrote:
>> On Wednesday, 11 May 2016 at 14:26:37 UTC, Vladimir Panteleev wrote: ...
>
> Hm. What's the point then of using
>
> import std.string : strip;
>
> as opposed to
>
> static import std.string;
>
> std.string.strip();
>
>

static import is useful when you have name conflict with another module. 
And some people prefer it because it is always visible from which module is 
that symbol accessible. I prefer local selective imports



More information about the Digitalmars-d-learn mailing list