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-Thread: 103376,1fa85f3df5841ae1 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread2.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7.3) Gecko/20040910 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada.Containers.Vectors - querying multiple elements References: <426e4c2b$0$7515$9b4e6d93@newsread2.arcor-online.net> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Thu, 28 Apr 2005 02:54:26 GMT NNTP-Posting-Host: 4.240.242.204 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.news.pas.earthlink.net 1114656866 4.240.242.204 (Wed, 27 Apr 2005 19:54:26 PDT) NNTP-Posting-Date: Wed, 27 Apr 2005 19:54:26 PDT Xref: g2news1.google.com comp.lang.ada:10770 Date: 2005-04-28T02:54:26+00:00 List-Id: Duncan Sands wrote: > 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. The standard components are not intended to be suitable for situations with exceptional requirements, as Randy B has made clear on many occasions. But if you can't accept the cost of Slice, you can always write your recursive algorithm to take the object and the 2 bounds. > 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. I'm not clear how you'd expect to use a subprogram that operates on an array with a container, except by converting the contents to an array, or rewriting it to use the container. -- Jeff Carter "Son of a window-dresser." Monty Python & the Holy Grail 12