equivariant functions

Denis Koroskin 2korden at gmail.com
Tue Oct 14 15:37:13 PDT 2008


On Tue, 14 Oct 2008 23:45:32 +0400, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:

> Simen Kjaeraas wrote:
>> I don't really see this as a problem. Returning mutable or invariant  
>> would be worse. Anyways, if you need the two arguments to be of the  
>> same type, I'd prefer this syntax:
>>    inout min(inout(A) a1, typeof(a1) a2){}
>
> IMHO we could simplify by discounting min. The major need is to pass the  
> type of one argument only. Min and max are templates anyway, and for  
> templates we have other ways to make things work.
>
> Andrei
>

IMHO, the solution should be consistent and general enough to cover  
templates, too, as well as zero, single and multiple input arguments.  
Templates would benefit from it, too, reducing the generated file size  
(there are many complains about this issue).



More information about the Digitalmars-d mailing list