[Issue 5508] Update startsWith to take a range of ranges

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 8 17:47:32 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=5508



--- Comment #5 from Andrei Alexandrescu <andrei at erdani.com> 2013-01-08 17:47:31 PST ---
(In reply to comment #4)
> (In reply to comment #3)
> > I understand. But that conflicts with the current semantics, which say that for
> > x and y of type T[], x.startsWith(y) is true iff y is a prefix of x.
> 
> But Y is of type Range!(T[]).

No, look again at your example. All ranges have type string[]. Did you actually
mean this?

import std.algorithm;

void main() {
    auto a = "\r\nHello";
    assert(startsWith(a, ["\n","\r\n"], ["H"]));
}

Note that now a is of type string.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list