This problem appears also in std.signals.
There is no possibility to use functions with ref parameters as signal handler.

import std.signals;

class Foo {
  mixin Signal!(int);
}
class Bar {
  void handler(ref int a) {}
}

void main() {
  Foo foo = new Foo;
  Bar bar = new Bar;
  foo.connect(&bar.handler);
}

outputs:
Error: function signals.Foo.Signal!(int).connect (void delegate(int) slot) is not callable using argument types (void delegate(ref int a))| Error: cannot implicitly convert expression (&bar.handler) of type void delegate(ref int a) to void delegate(int)


Reply via email to