August 21, 2017 function cannot access frame | ||||
---|---|---|---|---|
| ||||
cannot access frame of function I declared a helper function outside a lambda that is passed to C. The semantics are the same inside of the function as they are outside as far as code goes. How can I declare a function that essentially works inside the lambda also without having to do any real rewriting? e.g., if I could use a define #define foo(a,b) a + b would work great, that is all I really need, templates have the same issue as functions though. To make it work I used a mixin template, but that seems a bit obtuse ;/ e.g., template put() { int foo(a,b) { return a + b; } } mixin put; then I mixin it inside the lambda also. That way I have both contexts covered, not bad but... |
Copyright © 1999-2021 by the D Language Foundation