I dun a DIP, possibly the best DIP ever

Steven Schveighoffer schveiguy at gmail.com
Fri Apr 24 21:00:08 UTC 2020


On 4/24/20 4:15 PM, Walter Bright wrote:

> 
> Since then it's an array, use the existing array folding methods.

This is probably good enough, because we can generate arrays at 
compile-time and process them via CTFE.

Some key targets within std.meta are anySatisfy/allSatisfy.

A quick stab at this (I'm going to stick with the ellipsis version as 
it's easy to ):

import std.algorithm : canFind;
enum anySatisfy(alias F, T...) = [F!(T)...].canFind(true);
enum allSatisfy(alias F, T...) = ![F!(T)...].canFind(false);

Wow, that reads so clean.

I'm so in love with this feature, when can we get it in?

-Steve


More information about the Digitalmars-d mailing list