"Steven Schveighoffer" <[email protected]> wrote in message news:[email protected]... > Second, std.algorithm.count looks like this: > > size_t count(alias pred = "a == b", Range, E)(Range r, E value) if > (isInputRange!(Range)) > > So, E can be any type, completely unrelated to strings, I could do: > > count!(string, int[]) which makes no sense. > > I think the sig should be > > size_t count(alias pred = "a == b", Range, E)(Range r, E value) if > (isInputRange!(Range) && isImplicitlyConvertable!(E, ElementType!(Range))) > > -Steve
Except you can call it like this: string s = "1234"; int[] a = [1, 2, 3]; count!"cast(int)(a - '0') == b.length"(s, a); Which is perfectly valid.
