Challenge: Motivating examples for ...

Stefan Koch uplink.coder at googlemail.com
Sun Apr 26 19:41:30 UTC 2020


On Sunday, 26 April 2020 at 16:07:30 UTC, Steven Schveighoffer 
wrote:
> On 4/25/20 2:52 PM, Paul Backus wrote:
>> On Saturday, 25 April 2020 at 15:17:35 UTC, Steven 
>> Schveighoffer wrote:
>>> I propose a function any which takes a range and returns true 
>>> if any element matches the provided one. And another one 
>>> all(val) which does the same if all are the value. This gives 
>>> us maximum flexibility.
>> 
>> Looks like std.algorithm.any and std.algorithm.all can already 
>> do this.
>
> Nice! The only thing I would say is I don't want to have a 
> giant nest of subcalls for something like this, which can be 
> done with one foreach loop. I'll have to look at the 
> implementation.
>
> -Steve

If you need this implementation to be extended please drop me a 
line.


More information about the Digitalmars-d mailing list