Saying delete this in class [linked lists]

Started by
2 comments, last by kaffee 22 years, 7 months ago
I''m making a linked list and now I''m implementing methods to remove elements from the list. So, is it safe to say delete this in a method of a class or do I have to do it outside the class. In this case, delete this would be last call of a method. I haven''t actually tried this yet, but my common sense says no, but perhaps there is a neat solution to achieve this.. Comments, ideas, suggestions?
Advertisement
C++ FAQ 16.14 answers this question.

---
blahpers
---blahpers
However, I''ve yet to find a situation where I couldn''t delete the object some other way--such as from the previous object in the list. Still, it might be useful.

---
blahpers
---blahpers
http://world.std.com/~buzzard/computer/iterate.html

This topic is closed to new replies.

Advertisement