It turns out it's quite hard to have @safe pure nothrow functions. Oh, and const.

Kagamin via Digitalmars-d digitalmars-d at puremagic.com
Fri Sep 12 06:11:17 PDT 2014


On Friday, 12 September 2014 at 10:19:27 UTC, Jakob Ovrum wrote:
> Further, `inout` does not support considering callback 
> parameters to be "out parameters":
>
> struct S
> {
>     int* p;
>
>     inout(int)* foo() inout { return p; } // OK
>
>     void bar(void delegate(inout int*) dg) inout { // Not 
> supported
>         dg(p);
>     }
> }

Looks like it works: http://dpaste.dzfl.pl/04a33be05658


More information about the Digitalmars-d mailing list