From 4609902034445688947
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,1c452393d407b15c,start
X-Google-Attributes: gidf78e5,public
From: alexxandra@my-dejanews.com
Subject: removing list elements
Date: 1999/03/15
Message-ID: <7cj8nk$tmk$1@nnrp1.dejanews.com>#1/1
X-Deja-AN: 455282108
X-NNTP-Posting-Host: 128.38.135.64
Approved: stephen.clamage@sun.com (comp.std.c++)
X-UID: 0000000001
X-Status: $$$T
X-Http-User-Agent: Mozilla/4.04 [en] (WinNT; I)
X-Http-Proxy: 1.0 x4.dejanews.com:80 (Squid/1.1.22) for client 128.38.135.64
Organization: Deja News - The Leader in Internet Discussion
X-Article-Creation-Date: Mon Mar 15 15:24:50 1999 GMT
Reply-To: stehmanaf@nswc.navy.mil
Newsgroups: comp.std.c++
Originator: clamage@taumet


This problem has been described to me by a fellow developer, and I cannot find
much insight online or in books.  Using the STL list, we wanted to substitute
our home-grown implementation of a linked list.  However, we were storing
(pointers or references to) objects in the linked list and we've run into a
problem with the code dumping core from the stl section.  Should I assume it
is the developer's responsibility to remove the object when objects and not
straight data are being stored in the list?  If so, would a reasonable
solution be to overload list's remove() to call the destructor on the object
being removed?

Any insight/input/advice is very welcome.

Thanks,
Alexandra F. Stehman
Computer Scientist
Naval Surface Warfare Center, Dahlgren Division
17320 Dahlgren Road
Dahlgren, VA 22443

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]




