Assigning a method name to a variable and then calling it with an object

aliak something at something.com
Thu May 24 23:03:21 UTC 2018


Hi,

I was essentially trying to do this:

struct S {
   void f() {}
}

auto f = S.f; // f becomes void function(S) ??
S s;
f(s);

Is something like that possible?

Cheers,
- Ali


More information about the Digitalmars-d-learn mailing list