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

Jakob Ovrum via Digitalmars-d digitalmars-d at puremagic.com
Fri Sep 12 18:37:57 PDT 2014


On Friday, 12 September 2014 at 13:11:19 UTC, Kagamin wrote:
> 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

Now try calling it: http://dpaste.dzfl.pl/bbd02a4d61df


More information about the Digitalmars-d mailing list