"is" expression and type tuples

Jack Applegame via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Mar 3 08:56:23 PST 2015


On Tuesday, 3 March 2015 at 16:42:22 UTC, bearophile wrote:
> But it should be not too much hard to implement it your code. 
> Just use two is(), or use recursion (with splitting in two, and 
> not 1 + n-1).
>
> Bye,
> bearophile

I already have one:

> template Is(ARGS...) if(ARGS.length % 2 == 0) {
>     enum N = ARGS.length/2;
>     static if(N == 1) enum Is = is(ARGS[0] : ARGS[1]);
>     else enum Is = is(ARGS[0] : ARGS[N]) && Is!(ARGS[1..N], 
> ARGS[N+1..$]);
> }


More information about the Digitalmars-d-learn mailing list