Re: Searching for a T in a T[]

2016-06-22 Thread Nordlöw via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 08:07:51 UTC, David Nadlinger wrote: What about http://dlang.org/phobos/std_algorithm_searching.html#.canFind.canFind.2? My mistake. The reason for the template error message was another than I though of. Thanks.

Re: Searching for a T in a T[]

2016-06-22 Thread cym13 via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 08:04:34 UTC, Nordlöw wrote: Is there now algorithm (similar to `canFind`) that can search for a `T` in a `T[]`? Existing `canFind` only supports sub-sequence needles. I'm aware of `std.string.indexOf` but that's only for strings. I don't see why canFind isn't

Re: Searching for a T in a T[]

2016-06-22 Thread David Nadlinger via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 08:04:34 UTC, Nordlöw wrote: Is there now algorithm (similar to `canFind`) that can search for a `T` in a `T[]`? Existing `canFind` only supports sub-sequence needles. What about http://dlang.org/phobos/std_algorithm_searching.html#.canFind.canFind.2? — David

Searching for a T in a T[]

2016-06-22 Thread Nordlöw via Digitalmars-d-learn
Is there now algorithm (similar to `canFind`) that can search for a `T` in a `T[]`? Existing `canFind` only supports sub-sequence needles. I'm aware of `std.string.indexOf` but that's only for strings.