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,a3736685ef876ab2 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Newsgroups: comp.lang.ada Subject: Re: OO Style with Ada Containers From: Georg Bauhaus In-Reply-To: <5076f153-d879-43dd-b2c8-ad61eeea241d@d61g2000hsa.googlegroups.com> References: <1195082906.420079.195000@d55g2000hsg.googlegroups.com> <1s27rv0gt4ujj$.3e2k326rp54d.dlg@40tude.net> <60e46dc9-d8ca-4f47-9e8a-f90a7d45e752@w28g2000hsf.googlegroups.com> <0319d921-4457-4b47-87f2-3f310aaa3d93@o6g2000hsd.googlegroups.com> <5076f153-d879-43dd-b2c8-ad61eeea241d@d61g2000hsa.googlegroups.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1195582009.6450.51.camel@kartoffel> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Date: Tue, 20 Nov 2007 19:06:49 +0100 Organization: Arcor NNTP-Posting-Date: 20 Nov 2007 19:06:49 CET NNTP-Posting-Host: 5ee0b6ec.newsspool4.arcor-online.net X-Trace: DXC=86l75k905CG=8m7nZkdN^@4IUKBbd]60kAQYiC=kbmW`a1fGGC`2T@AUZfCKmTn[;DW:HCF X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:18535 Date: 2007-11-20T19:06:49+01:00 List-Id: On Tue, 2007-11-20 at 06:11 -0800, Maciej Sobczak wrote: > Two points: > > 1. > The most important part of STL is the notion of range-based iteration. ... > Ada.Containers does not support anything like this. I think Ada containers do support range-based iteration. In fact, the Floor and Ceiling operations of ordered maps (similar to C++ STL's lower_bound() and upper_bound()) will give you a cursor, and the Cursor's interface includes "/=" ... > The only available > algorithms work on whole containers. That, again, is the algorithm question, isn't it? You get two cursors, do something with them. For example, feed them to a generic sum. Some algorithms can be found in the Charles library (<= AI302, <= Ada.Containers). http://charles.tigris.org > 2. > Another important part of STL is the notion of iterator category. > Depending on the category, the iterator can support different sets of > operations. The most powerful is RandomAccessIterator, which allows to > arbitrarily jump around the sequence in constant time. This particular case can be handled using Vector's Extended_Index subtype, " because vector itself is inherently random-accessible." To the extent that Extended_Index does not establish iterator categories.