From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,93ab7fc5388e249 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-05 08:50:26 PST Sender: sjw@galadriel.frlngtn.gecm.com Newsgroups: comp.lang.ada Subject: Re: List container strawman 1.3 References: <3C0E1FA1.45A38A75@brighton.ac.uk> From: Simon Wright Date: 05 Dec 2001 16:44:43 +0000 Message-ID: Organization: Alenia Marconi Systems, ISD, Farlington X-Newsreader: Gnus v5.5/Emacs 20.3 NNTP-Posting-Host: galadriel.frlngtn.gecm.com X-Trace: 5 Dec 2001 16:46:06 GMT, galadriel.frlngtn.gecm.com Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newspeer.clara.net!news.clara.net!news-hub.cableinet.net!blueyonder!btnet-peer!btnet-peer0!btnet-peer1!btnet-feed5!btnet!newreader.ukcore.bt.net!pull.gecm.com!galadriel.frlngtn.gecm.com Xref: archiver1.google.com comp.lang.ada:17454 Date: 2001-12-05T16:44:43+00:00 List-Id: John English writes: > Why does the iterator type need to be controlled? What's your mental > model of what an iterator consists of? Mine generally says that an > iterator contains a couple of pointers to a list somewhere else, but > that the iterators aren't responsible for deallocating that > list... is this something caused by the safe iterator requirement > perhaps? (Which I disagree with, incidentally... safe iterators can > probably be built on top of unsafe ones, but starting with safe ones > means a lot of possibly unnecessary overhead.) The BC Iterators are controlled so that creating an Iterator _can_ Lock the container it's iterating over, and deleting the Iterator (by exiting the scope) will Unlock. That said, the implication is that only one Iterator can be active for a given container at any one time. Actually using such a beast is going to be tricky, I think. The C++ BCs didn't address this problem as far as I can see (there are no substantive comments in the source ..) -- Simon Wright Email: simon.j.wright@amsjv.com Alenia Marconi Systems Voice: +44(0)23 9270 1778 Integrated Systems Division FAX: +44(0)23 9270 1800