equivariant functions

Bill Baxter wbaxter at gmail.com
Tue Oct 14 17:14:06 PDT 2008


On Wed, Oct 15, 2008 at 6:23 AM, Denis Koroskin <2korden at gmail.com> wrote:
> On Wed, 15 Oct 2008 01:18:40 +0400, Robert Fraser
> <fraserofthenight at gmail.com> wrote:
>
>> Andrei Alexandrescu wrote:
>>>
>>> Yah, that's where the PassQual template is needed. I'd agree without joy
>>> that, if handling true equivariance is too unwieldy, we can resign to
>>> solving only equivariance in qualifier.
>>
>> FWIW, people have done without type eqivariance w/o complaint since static
>> typing was invented. People have been complaining about const equivariance
>> since at least C++ and D makes it worse.
>
> People didn't complain that they were nude until someone discovered it :)
> I mean, human needs grow over time as they discover something useful.

Agreed.  There are uses for equivariance if you have it.
I think especially so when thinking about functional style programming
where you are chaining many functions together.  It's nice if the
chain you create doesn't lose the input object's true most derived
identity.  You can fake it with templates if you really have to, but
then if they are member functions they become non-virtual.

--bb



More information about the Digitalmars-d mailing list