Passing parameters to thread functions

via Digitalmars-d digitalmars-d at puremagic.com
Mon Aug 17 02:42:49 PDT 2015


On Saturday, 15 August 2015 at 23:45:29 UTC, deadalnix wrote:
> Delegate do not come with a type qualifier for their payload, 
> so there is no way to do otherwize.

Looks like they do:

     alias X = void delegate() const;
     void z(X fun) { fun(); }

     void main() {
         int a;
         z({ a = 42; });
     }

xx.d(6): Error: function xx.z (void delegate() const fun) is not 
callable using argument types (void delegate() pure nothrow @nogc 
@safe)



More information about the Digitalmars-d mailing list