equivariant functions

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Oct 13 05:25:33 PDT 2008


Christian Kamm wrote:
> Can you, given an alias to a function that uses this equivariance, create a
> forwarder function with the exact same behaviour? I.e. will calls to
> 
> typeof(return) identity(alias fn)(ParameterTuple!(fn) args) {
>   return fn(args);
> }
> 
> or similar work exactly as calls to fn, even though typeof(return) has to be
> more than just a type? The parameter storage classes ref, out, lazy already
> make this kind of forwarding very tricky to do right (I think you have to
> escape to mixins) and I fear this'll make it even more involved.

I think so. Technically the problem is similar to handling an overloaded fn.

Andrei



More information about the Digitalmars-d mailing list