Now that's a DIP that could use some love

Andrei Alexandrescu SeeWebsiteForEmail at
Thu Sep 17 21:47:53 UTC 2020

On 9/17/20 5:40 PM, H. S. Teoh wrote:
> How exactly does adding
> a string description to .each's sig constraints help in any way?
> Wouldn't they just repeat what the names of the clauses already say?

Emphatically NO!

How is this:

mymodule.d(4): Error: template onlineapp.main.each!((x) => 
writeln(x)).each cannot deduce function from argument types !()(int), 
candidates are:
       each(Range)(Range r)
   with Range = int
   must satisfy one of the following constraints:
        __traits(compiles, typeof(r.front).length)
        each(Iterable)(auto ref Iterable r)
   with Iterable = int
   must satisfy one of the following constraints:
        __traits(compiles, Parameters!(Parameters!(r.opApply)))

the same as this:

mymodule.d(42): "Attempting to use `each` with type `int`, which cannot 
be iterated using a foreach loop."


I mean how can anyone not chuckle at this crap? Did you guys gang on me 
with a prank?

More information about the Digitalmars-d mailing list