Borrowing and Ownership

Timon Gehr timon.gehr at gmx.ch
Mon Oct 28 00:37:32 UTC 2019


On 27.10.19 23:36, Timon Gehr wrote:
>      ~this(){
>          destroy((()@trusted=>payload)());
>          ()@trusted{
>              free(payload);
>              payload=null;
>          }
>      }

Of course, this should be:

~this(){
     destroy((()@trusted=>payload)());
     ()@trusted{
         free(payload);
         payload=null;
     }();
}


More information about the Digitalmars-d mailing list