Re:The Dark Side of C++ [pdf]
by geophile on Monday August 02, 2010 @11:44AM
(#1567926)
The author points out that auto_ptr is useless. shared_ptr is broken too. What do you think this program does?
[ Parent
| on HN ]
I don't see the problem. The nodes of the list are freed from beginning to end, and then "Done" is printed. What's supposed to be wrong here?
Stack overflow for large n.
Ah, I didn't consider that. A decent optimizing compiler should be able to remove all the tail calls (G++ did this with your code and -O2), so this shouldn't be a problem in practice, except maybe for debugging.