4 ms·
If it behaves like that it is not a closure.
by hexo 3y ago
If it behaves like that it is not a closure.
- peoplefromibiza 3y agoa closure can capture either the value or the reference of the variables. in this case it captured the reference which at the time of invocation always pointed to the same value.
- hexo 3y agocapturing by reference is nonsense in 99.9999999% cases
- peoplefromibiza 3y agoit still makes it a valid closure.
- hexo 3y agoas you could have seen it does not make a valid closure, only source of bugs