Re: countUntil's constraints

2018-08-08 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/7/18 10:28 PM, Nicholas Wilson wrote: On Wednesday, 8 August 2018 at 01:33:26 UTC, Steven Schveighoffer wrote: On 8/7/18 9:20 PM, Nicholas Wilson wrote: the first overload is ptrdiff_t countUntil(alias pred = "a == b", R, Rs...)(R haystack, Rs needles) if (isForwardRange!R && Rs.length

Re: countUntil's constraints

2018-08-07 Thread Nicholas Wilson via Digitalmars-d-learn
On Wednesday, 8 August 2018 at 01:33:26 UTC, Steven Schveighoffer wrote: On 8/7/18 9:20 PM, Nicholas Wilson wrote: the first overload is ptrdiff_t countUntil(alias pred = "a == b", R, Rs...)(R haystack, Rs needles) if (isForwardRange!R && Rs.length > 0 && isForwardRange!(Rs[0]) ==

Re: countUntil's constraints

2018-08-07 Thread Nicholas Wilson via Digitalmars-d-learn
On Wednesday, 8 August 2018 at 01:33:26 UTC, Steven Schveighoffer wrote: On 8/7/18 9:20 PM, Nicholas Wilson wrote: the first overload is ptrdiff_t countUntil(alias pred = "a == b", R, Rs...)(R haystack, Rs needles) if (isForwardRange!R && Rs.length > 0 && isForwardRange!(Rs[0]) ==

Re: countUntil's constraints

2018-08-07 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/7/18 9:20 PM, Nicholas Wilson wrote: the first overload is ptrdiff_t countUntil(alias pred = "a == b", R, Rs...)(R haystack, Rs needles) if (isForwardRange!R && Rs.length > 0 && isForwardRange!(Rs[0]) == isInputRange!(Rs[0]) && is(typeof(startsWith!pred(haystack, needles[0]))) &&

countUntil's constraints

2018-08-07 Thread Nicholas Wilson via Digitalmars-d-learn
the first overload is ptrdiff_t countUntil(alias pred = "a == b", R, Rs...)(R haystack, Rs needles) if (isForwardRange!R && Rs.length > 0 && isForwardRange!(Rs[0]) == isInputRange!(Rs[0]) && is(typeof(startsWith!pred(haystack, needles[0]))) && (Rs.length == 1 ||