<div>A)</div><div>I'd like to simplify notation of template function declarations involving only single-argument boolean template constraints as follows:</div><div><br></div><div>example:</div><div>A1: 'auto myfunction ( isSomeString a, isInputRange b) {...}'</div>
<div><br></div><div>would be rewritten by compiler as:</div><div><div>A2: 'auto myfunction(T0,T1) (T0 a, T1 b) if(isSomeString!T1 a && isInputRange!T b) {...}'</div></div><div><br></div><div>IMO, A1 is less verbose and clearer than A2. </div>
<div><br></div><div>Obviously, more complex template constraints would still require the full syntax, but I'd argue this case is the most common.</div><div><br></div><div><br></div><div>More generally, the compiler would rewrite:</div>
<div><div>'auto myfunction(Tj...) (modifier_i Ei ai,...) if(condition(Tj) ) {...}'</div></div><div>as:</div><div>'auto myfunction(Tj...,T'k...) (modifier_i E'i ai,...) if(condition(Tj) && Ek!T'k &...) {...}'</div>
<div>where, for each i, if Ei is the name (in current scope) of a template that has a single argument and that returns a boolean, then introduce E'i as type T'i, else E'i=Ei; and k ranges over the list of indexes i that represent the former case.</div>
<div><br></div><div><br></div><div>B)</div><div>Secondly, ddoc doesn't generate template constraints or does so very inconsistently :</div><div>in <a href="http://dlang.org/phobos/std_algorithm.html">http://dlang.org/phobos/std_algorithm.html</a> we have:</div>
<div>template map(fun...) if (fun.length >= 1);</div><div>but all other template constraints are omitted, eg:</div><div><div>void fill(Range, Value)(Range range, Value filler); // template constraint omitted.</div></div>
<div>Using the notation proposed in A, wherever applicable, would make documentation clear.</div><div><br></div>