Login | Register
My pages Projects Community openCollabNet

Discussions > users > Ada.Containers.Vectors - querying multiple elements

charles
Discussion topic

Back to topic list

Ada.Containers.Vectors - querying multiple elements

Reply

Author Duncan Sands <baldrick at free dot fr>
Full name Duncan Sands <baldrick at free dot fr>
Date 2005-04-26 04:43:52 PDT
Message I've been playing around with Ada.Containers.Vectors (part of Ada 2005,
see http://charles.tigris.org/; look for AI-302) and noticed that
there's no way to view or operate on a "slice" of a vector. There's a
routine

   procedure Query_Element
       (Container : in Vector;
        Index : in Index_Type;
        Process : not null access procedure (Element : in Element_Type));

for looking at one element; I'd like something like this:

   procedure Query_Elements
       (Container : in Vector;
        First_Index : in Index_Type;
        Last_Index : in Extended_Index;
        Process : not null access procedure (Elements : in Element_Array));

where Element_Array would be:

   type Element_Array is array (Index_Type range <>) of Element_Type;

Is there any reason no such routine exists? It would be good to have for both
efficiency reasons and simple implementation of certain classes of algorithms.
In my case I have a "divide and conquer" recursive algorithm which while it
can be written using the current package, would be simpler to write if something
like Query_Elements existed.

All the best,

Duncan.

« Previous message in topic | 1 of 7 | Next message in topic »

Messages

Show all messages in topic

Ada.Containers.Vectors - querying multiple elements Duncan Sands <baldrick at free dot fr> Duncan Sands <baldrick at free dot fr> 2005-04-26 04:43:52 PDT
     Re: Ada.Containers.Vectors - querying multiple elements Matthew Heaney <mheaney at on2 dot com> Matthew Heaney <mheaney at on2 dot com> 2005-04-26 08:11:07 PDT
         Re: Ada.Containers.Vectors - querying multiple elements Duncan Sands <baldrick at free dot fr> Duncan Sands <baldrick at free dot fr> 2005-04-26 09:00:11 PDT
             Re: Ada.Containers.Vectors - querying multiple elements Matthew Heaney <mheaney at on2 dot com> Matthew Heaney <mheaney at on2 dot com> 2005-04-26 10:00:10 PDT
                 Re: Ada.Containers.Vectors - querying multiple elements Georg Bauhaus <bauhaus at arcor dot de> Georg Bauhaus <bauhaus at arcor dot de> 2005-04-29 06:17:54 PDT
                     RE: Ada.Containers.Vectors - querying multiple elements matthewjheaney Matthew Heaney 2005-05-01 16:04:37 PDT
                         Re: Ada.Containers.Vectors - querying multiple elements Georg Bauhaus <bauhaus at arcor dot de> Georg Bauhaus <bauhaus at arcor dot de> 2005-05-02 15:01:35 PDT
Messages per page: