Empowering foreach with multiple aggregates

Janice Caron caron800 at googlemail.com
Sun Sep 9 04:46:06 PDT 2007


Wow! You're good!



>   static if(isArray!(T)) alias typeof(T[0]) IT;
>   else alias ParameterTypeTuple!(
>     ParameterTypeTuple!(
>       typeof(&T.init.opApply)
>     )[0]
>   )[$-1] IT;

Sorry to jump threads here, but this is a really good example of why
alias dst=src; would be a good thing. It took me a long time and a lot
of counting parantheses to figure out that IT was being defined!

Anyway - that is excellent.

I guess the next question would be, can this trick be built into the
language in an easy-to-use way. Or in Phobos?



More information about the Digitalmars-d mailing list