D and Secure Programming

Jacob via Digitalmars-d digitalmars-d at puremagic.com
Sun Oct 2 20:50:29 PDT 2016


     import std.stdio;

     struct SomeStruct
     {
         int value;

         void func()
         {
             writeln(value);
         }

     }

     void main()
     {
         SomeStruct someStruct;
         someStruct.value = 333;

         auto func = cast(void function(ref 
SomeStruct))&SomeStruct.func;

         func(someStruct);
     }

Has worked so far for me.


More information about the Digitalmars-d mailing list