Re: Ada.Containers.Vectors - querying multiple elements
- From: Duncan Sands <baldrick@xxxxxxx>
- Date: Wed, 27 Apr 2005 09:21:45 +0200
Hi Jeffrey,
> IMNSHO, a unbounded-array abstraction doesn't need such operations, nor
> cursors. One should use it in a manner very similar to an array:
>
> for I in Index'First .. Last (Container) loop
> -- operate on Get (Container, I)
> end loop;
that isn't the only way of using an array. The example of recursive
algorithms taking subarrays was already mentioned. With the spec you
included, it looks like you would have to use the Slice function to
get a subarray - this means returning a copy on the stack, which is
unacceptable if the array is long, and also problematic (=maybe very
costly) if it contains controlled elements.
Also, if you want to use a low-level or legacy routine that operates
on an array, then you have a similar need to copy.
Ciao,
D.
.
- Follow-Ups:
- Re: Ada.Containers.Vectors - querying multiple elements
- From: Jeffrey Carter
- Re: Ada.Containers.Vectors - querying multiple elements
- References:
- Ada.Containers.Vectors - querying multiple elements
- From: Duncan Sands
- Re: Ada.Containers.Vectors - querying multiple elements
- From: Georg Bauhaus
- Re: Ada.Containers.Vectors - querying multiple elements
- From: Jeffrey Carter
- Ada.Containers.Vectors - querying multiple elements
- Prev by Date: Re: Typical Newbie Problem: Tone Generation
- Next by Date: gtk 2.6
- Previous by thread: Re: Ada.Containers.Vectors - querying multiple elements
- Next by thread: Re: Ada.Containers.Vectors - querying multiple elements
- Index(es):
Relevant Pages
|
|