3 ms·
I think you miss the point, the OP was mentioning the property that in most languages, closures whose outer variables they are bringing into scope stay in scope
by moonshinefe 10y ago
I think you miss the point, the OP was mentioning the property that in most languages, closures whose outer variables they are bringing into scope stay in scope (even if the outer function ends). In C++ they expire (is what I got from his comment, anyway).
- gpderetta 10y agoClosed-by-value variables (I.e. the default) in C++ don't expire. Referenced or pointed-to object might, but this is completely consistent with the rest of the language. Remember that C++ is a by value language. Pointers are explicit, fist class and distinct from the pointed to object. References are werid, though.