How to implement functor-like objects if ref is storage class?

void foo(ref int a) { a--; }
struct functor(A...) {
  void function(A) functor;
}
functor!int f;    // functor!(ref int) - wrong
f.functor = &foo; // Error: cannot implicitly convert expression (& foo) of type void function(ref int a) to void function(int)

Reply via email to