[Issue 5507] New: countUntil should take Ranges... instead of R2

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jan 30 11:20:38 PST 2011


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

           Summary: countUntil should take Ranges... instead of R2
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: andrei at metalanguage.com
        ReportedBy: Jesse.K.Phillips+D at gmail.com
                CC: Jesse.K.Phillips+D at gmail.com


--- Comment #0 from Jesse Phillips <Jesse.K.Phillips+D at gmail.com> 2011-01-30 11:18:23 PST ---
The recent addition of countUntil makes use of the startsWith template function
which has an overload for accepting many ranges. By modifying the signature you
can take advantage of this overload at no additional code:

- sizediff_t countUntil(alias pred = "a == b", R1, R2)(R1 haystack, R2 needle)
+ sizediff_t countUntil(alias pred = "a == b", R1, Ranges...)(R1 haystack,
Ranges needle)

https://github.com/D-Programming-Language/phobos/blob/master/std/algorithm.d#L3239

-- 
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