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,1c4bf3a1bd5d40f3 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-08 12:53:10 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!postnews1.google.com!not-for-mail From: mheaney@on2.com (Matthew Heaney) Newsgroups: comp.lang.ada Subject: Re: Booch: missing r/w access through iterators Date: 8 Nov 2002 12:53:09 -0800 Organization: http://groups.google.com/ Message-ID: <1ec946d1.0211081253.383f07dc@posting.google.com> References: <3dc92622$0$308$bed64819@news.gradwell.net> <3dcb4b43$0$307$bed64819@news.gradwell.net> NNTP-Posting-Host: 66.162.65.162 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1036788790 8637 127.0.0.1 (8 Nov 2002 20:53:10 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 8 Nov 2002 20:53:10 GMT Xref: archiver1.google.com comp.lang.ada:30610 Date: 2002-11-08T20:53:10+00:00 List-Id: porton@ex-code.com (Victor Porton) wrote in message news:<3dcb4b43$0$307$bed64819@news.gradwell.net>... > > So, if you insist on not aliased container items in general, you > however can (and please do so): > > 1. Add procedure to assign a value to the current item: > > procedure Assign_Current_Item (It : Iterator; Value : Item) is abstract; > -- Alternatively it can be not abstract but using Iterator_Operations > -- (see below). The Charles library already has this operation: procedure Replace_Element (Iterator : Iterator_Type; Item : Element_Type); However, getting a copy of the element out of the container, modifying the copy, and then replacing the element with the value of the copy is probably not as efficient as simply modifying the element in place, as I have illustrated in previous posts. Charles is available at my home page: http://home.earthlink.net/~matthewjheaney/charles/index.html