3 ms·
You would need immutability (or a static type system) to do that safely though. And I don’t think you can check the closed over objects before the closure is ac
by CuriousSkeptic 9y ago
You would need immutability (or a static type system) to do that safely though. And I don’t think you can check the closed over objects before the closure is actually scheduled to execute (perhaps if you limit the closure to const references)
But, since you can pass a context explicitly to map and friends you might get away with checking that for immutability.