Should this work?

Jacob Carlborg doob at me.com
Fri Jan 24 00:21:12 PST 2014


On 2014-01-23 21:53, Andrei Alexandrescu wrote:

> Ionno. Just look at the current morass with
> https://github.com/D-Programming-Language/phobos/pull/1875. We have two
> names for the same function "canFind" and "any". Then we want to
> deprecate one, but look at how much impact it's having on Phobos alone.
> Are you sure you want to add a _third_?

Personally I would expect "any" to take a predicate and return "true" if 
it can find any matching element. If a predicate is not supplied it 
would behave as the opposite of "empty".

I would expect "contains" to take a element and check if it exists in 
the range.

I think "canFind" is just a weird name.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list