equivariant functions

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Oct 14 18:30:52 PDT 2008


Denis Koroskin wrote:
> 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).

If you can find a solution that is simple and general enough, my hat is 
off to you.

Andrei



More information about the Digitalmars-d mailing list