4 ms·
> push an argument to a list, and pass the list in another argument, making the original temporary accessible from any recursion level. Either you push a copy
by im3w1l 6y ago
> push an argument to a list, and pass the list in another argument, making the original temporary accessible from any recursion level.
Either you push a copy of the object to the list, in which case it is fine. Or you push a pointer/reference to the object, in which case it becomes dangling.
- yakubin 6y agoExactly. It wouldn't be dangling without the transformation you proposed.