DIP10005: Dependency-Carrying Declarations is now available for community feedback

Andrej Mitrovic via Digitalmars-d digitalmars-d at puremagic.com
Wed Dec 14 09:24:42 PST 2016


On Wednesday, 14 December 2016 at 17:09:44 UTC, ketmar wrote:
>> bool equal(R1, R2) : std.range, std.traits
>> if (isInputRange!R1 && isInputRange!R2 && isArray!R2)
>> { ... }
>
> breaks possible selective import. if both modules exports some 
> symbol, we will need to selectively import and/or rename it.

Not necessarily. The first colon is the only special case, 
afterwards you can use all forms of imports:

>> bool equal(R1, R2) : std.range : isInputRange, Trait = 
>> std.traits
>> if (isInputRange!R1 && isInputRange!R2 && Trait.isArray!R2)
>> { ... }


More information about the Digitalmars-d mailing list