|
|
|
|
|
by tombert
78 days ago
|
|
Not the OP, but I'm thinking about like closures? Say you wanted to make a Node.js framework with callbacks that react to an event. The callback might be a closure that captured some of its surrounding variables. At that point, any of the captured variables are not trivially stack-allocated. You might be able to do something similar to what Rust does with moving though. |
|
The tldr is you had to preallocate a struct with anything you wanted captured ahead of time.