On 7/7/13, Peter Alexander <peter.alexander...@gmail.com> wrote:
> Still looks like half-assed functional programming to me.

Yep I agree.

> Where's the iteration? Why can't I write this?
>
> template allSatisfy(alias F, T...) {
>      foreach(t; T)
>          if (!F!(t))
>              return false;
>      return true;
> }

Also why not be able to write this (yes I know we can use Filter!()
but this is just an example):

template GetIntegrals(Types...)
{
    foreach (T; Types)
    {
        static if (isIntegral!T)
            GetIntegrals ~= T;  // GetIntegrals becomes a typetuple
    }
}

This beats the whole recursive template madness which we always have
to write (again there's the D language, and the "template" language,
just like in C++)

Maybe it would even speed things up not having to recursively
instantiate the template many times.

Reply via email to