std.string import cleanup: how to fix regression?

Daniel Kozak via Digitalmars-d digitalmars-d at puremagic.com
Thu Nov 13 00:31:56 PST 2014


On Thursday, 13 November 2014 at 08:18:22 UTC, Daniel Kozak wrote:
> On Wednesday, 12 November 2014 at 17:52:27 UTC, Dicebot wrote:
>> Will this work?
>>
>> static import std.string;
>> deprecated public alias split = std.string.split;
>
> Yes, but not for all cases. If I have code where I import 
> std.string and use std.algoritm.startsWith(...), then it would 
> not work

But this can be solved by something like this:

deprecated {
     static struct std {
         static struct algorithm {
             static import std.algorithm;
             alias startsWith = std.algorithm.startsWith;
         }
     }
}

However than you can`t use global imports


More information about the Digitalmars-d mailing list