Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!munnari!uqcspe!batserver!anthony From: anthony@batserver.cs.uq.oz (Anthony Lee) Newsgroups: comp.lang.c++ Subject: Possible error in Stroustrup ? Message-ID: <774@batserver.cs.uq.oz> Date: 1 Jun 89 12:51:47 GMT Sender: news@batserver.cs.uq.oz Reply-To: anthony@batserver.cs.uq.oz Lines: 21 On page 205 of "The C++ programming language" by Stroustrup, there is listing of a get function for circular list class slist. ent slist::get() { if (last == 0) slist_handler("get from empty slist"); slink* f = last->next; ent r = f->e; last = (f==last) ? 0 : f->next; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ delete f; return r; } The line starting with "last = ...." seems to be wrong. The function get is suppose to return and remove the head of the list. Can anyone confirm this ? Anthony Lee (Humble PhD student) (alias Doctor(Time Lord)) ACSnet: anthony@batserver.cs.uq.oz TEL: (07) 3712651 (07) 3774139 (w) SNAIL: 243 Carmody Rd, St Lucia, 4067 Australia