On Wednesday, 15 February 2017 at 19:39:52 UTC, Andrei Alexandrescu wrote:
On 02/15/2017 06:20 AM, Daniel N wrote:
On Wednesday, 15 February 2017 at 09:22:14 UTC, Daniel N wrote:
template every(T...)
{
    template satisfies(U...)
    {
        enum satisfies = true;
    }
}

(lunch-break => time to hack D!)

template every(T...)
{
  template satisfies(U...)
  {
    enum satisfies = {
      foreach(t; T)
        foreach(u; U)
      if(!u!t)
            return false;
      return true;
    }();
  }
}

That looks pretty neat. Can you find 4-5 cases in which this could be used gainfully in Phobos? Thanks! -- Andrei

Thanks, I'll get back to you. Unfortunately I just contracted fever, not fit to leave bed. Nothing dangerous, just am K.O.

Reply via email to