Re: Ada.Containers.Vectors - querying multiple elements



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.

.



Relevant Pages

  • Re: Ada Popularity: Comparison of Ada/Charles with C++ STL (and Perl)
    ... > while Has_Element loop ... > container, the passive iterator is preferred: ... > If you have an array type, then you can give it a container-like ...
    (comp.lang.ada)
  • RE: Error 3021
    ... Create proto-file names using the selected job names and storre to an array ... Save and close the document and repeat the loop ... Dim strJobsAs String, strDocsAs String, varValsAs _ ...
    (microsoft.public.access.modulesdaovba)
  • RE: Error 3021
    ... Kevin Backmann ... Create proto-file names using the selected job names and storre to an array ... Save and close the document and repeat the loop ... Dim strJobsAs String, strDocsAs String, varValsAs _ ...
    (microsoft.public.access.modulesdaovba)
  • RE: Error 3021
    ... Create proto-file names using the selected job names and storre to an array ... Save and close the document and repeat the loop ... Dim strJobsAs String, strDocsAs String, varValsAs _ ...
    (microsoft.public.access.modulesdaovba)
  • Re: Displaying a large amount of data quickly (VB6)
    ... >>> involving a loop of VB code would be too slow. ... but I'd sure be interested to know if that StringBuilder ... Array elements: 25000 ... Array construction: 17 ...
    (microsoft.public.vb.controls)