countUntil's constraints

Nicholas Wilson iamthewilsonator at hotmail.com
Wed Aug 8 01:20:38 UTC 2018


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
|| is(typeof(countUntil!pred(haystack, needles[1 .. $])))))

What does `isForwardRange!(Rs[0]) == isInputRange!(Rs[0]` mean 
here?
Is it just the same as `isForwardRange!(Rs[0])`? Why is it 
written like that?


More information about the Digitalmars-d-learn mailing list