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,f89c9977a6e4ceda X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-09 01:03:10 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed.stueberl.de!news-peer.gradwell.net!not-for-mail Newsgroups: comp.lang.ada From: porton@ex-code.com (Victor Porton) Date: Sat, 09 Nov 2002 13:24:51 +0500 References: <3dcb8eec$0$307$bed64819@news.gradwell.net> Subject: Re: Missing in Booch: range operations Mime-Version: 1.0 X-Newsreader: knews 1.0b.1 Content-Type: text/plain; charset=us-ascii Message-ID: <3dcccf4d$0$308$bed64819@news.gradwell.net> NNTP-Posting-Date: 09 Nov 2002 09:03:09 GMT NNTP-Posting-Host: 195.149.39.13 X-Trace: 1036832589 news.gradwell.net 308 mail2news/195.149.39.13 X-Complaints-To: news-abuse@gradwell.net Xref: archiver1.google.com comp.lang.ada:30626 Date: 2002-11-09T09:03:09+00:00 List-Id: In article <1ec946d1.0211081307.24a6c05c@posting.google.com>, mheaney@on2.com (Matthew Heaney) writes: > porton@ex-code.com (Victor Porton) wrote in message news:<3dcb8eec$0$307$bed64819@news.gradwell.net>... >> BTW, these should throw an exception if the begin and the end of the >> range are from different containers. > > The problem is that iterators only know about elements -- they don't > know anything about containers. Neither Charles nor the STL attempts > to detect this error. For some classes of containers e.g. for linked lists it is possible: throw an exception if te end of list reached (actually Ada compilers will throw these "automagically"). A good thing to have a debug version where iterators "know" about containers. See www.STLport.org for an C++ STL with extensive debugging.