Why is there no or or and ?

Jonathan M Davis jmdavisProg at gmx.com
Fri Feb 17 02:08:31 PST 2012


On Friday, February 17, 2012 09:47:50 Andrej Mitrovic wrote:
> The better question is why is there no 'any' and 'all' template in Phobos!

You mean as in a function which returns whether any element in a range matches 
a predicate and a function which returns whether all elements in a range match 
a predicate?

Well, canFind gives you any functionality-wise. There's some debate as to 
whether there should be an alias to any or if the one overload of canFind that 
arguably should be any should just be changed to any. So, I'm not quite sure 
what's going to happen there, but there's at least a decent chance that we'll 
end up with a function actually called any.

There _is_ a pull request for all though.

- Jonathan M Davis


More information about the Digitalmars-d mailing list