Fun with inout

Manu via Digitalmars-d digitalmars-d at puremagic.com
Sat Sep 6 04:46:07 PDT 2014


Interesting. You're attacking it from the ReturnType! angle... I didn't
think of that.

I had to stare at this for like 10 minutes to work out how it works ;)
I think I can use this, but I'm not sure it addresses the hole in phobos?


On 6 September 2014 21:00, Kagamin via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:

> template ReturnType1(alias F, TArg)
> {
>         alias ReturnType1=typeof((){
>                 ReturnType!F function(inout Unqual!TArg) test;
>                 TArg testv;
>                 return test(testv);
>         }());
> }
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20140906/c7818beb/attachment.html>


More information about the Digitalmars-d mailing list