4 ms·
a 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
by peoplefromibiza 3y ago
a 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