comp.lang.ada
 help / color / mirror / Atom feed
From: mheaney@on2.com (Matthew Heaney)
Subject: Re: Booch: missing r/w access through iterators
Date: 8 Nov 2002 12:53:09 -0800
Date: 2002-11-08T20:53:10+00:00	[thread overview]
Message-ID: <1ec946d1.0211081253.383f07dc@posting.google.com> (raw)
In-Reply-To: 3dcb4b43$0$307$bed64819@news.gradwell.net

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



  reply	other threads:[~2002-11-08 20:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-06 14:18 Booch: missing r/w access through iterators Victor Porton
2002-11-06 16:42 ` Simon Wright
2002-11-07  4:21 ` Victor Porton
2002-11-07 21:04   ` Simon Wright
2002-11-08 20:49     ` Matthew Heaney
2002-11-08 20:37   ` Matthew Heaney
2002-11-08  5:21 ` Victor Porton
2002-11-08 20:53   ` Matthew Heaney [this message]
2002-11-08 20:33 ` Matthew Heaney
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox