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,f2690a5e963b61b6 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!atl-c03.usenetserver.com!elnk-atl-nf1!newsfeed.earthlink.net!stamper.news.atl.earthlink.net!newsread2.news.atl.earthlink.net.POSTED!14bb18d8!not-for-mail Sender: mheaney@MHEANEYX200 Newsgroups: comp.lang.ada Subject: Re: GCC 4.0 Ada.Containers Cursor danger. References: <1120474891.635131.216700@g44g2000cwa.googlegroups.com> <1120575076.876798.108220@g44g2000cwa.googlegroups.com> <1120583470.429264.325450@g43g2000cwa.googlegroups.com> <1120639461.224146.235430@g44g2000cwa.googlegroups.com> <1120642489.101644.74190@o13g2000cwo.googlegroups.com> <1120643138.031761.212450@g43g2000cwa.googlegroups.com> <42cbb52c$0$10807$9b4e6d93@newsread4.arcor-online.net> <1120666922.733581.179180@g47g2000cwa.googlegroups.com> <42cc1f0f$0$10808$9b4e6d93@newsread4.arcor-online.net> <1120739383.801736.224270@o13g2000cwo.googlegroups.com> <1120741261.884195.86680@g43g2000cwa.googlegroups.com> From: Matthew Heaney Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 07 Jul 2005 13:20:08 GMT NNTP-Posting-Host: 24.149.57.125 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.news.atl.earthlink.net 1120742408 24.149.57.125 (Thu, 07 Jul 2005 06:20:08 PDT) NNTP-Posting-Date: Thu, 07 Jul 2005 06:20:08 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: g2news1.google.com comp.lang.ada:11932 Date: 2005-07-07T13:20:08+00:00 List-Id: "Dmitriy Anisimkov" writes: > << Fine, then write this yourself: >> > > I could write it for sure. But why Ada.Containers user have to write > safety wrappers for Ada standard library ? Users who want and > understand safety would prefer different containers library. Of course the library already has a passive iterator, declared like this: procedure Iterate (Container : CT; Process : not null access procedure Process (Posn : Cursor)); We designed the passive iterator around the common case, which is to visit every element in the container. You have a special need: for a stop parameter, and to always pass both the key and the element to the process procedure. The library gives you the tools to construct such an abstraction, which is what I showed in my previous post. > Don't say please that "You are free to use whatever containers > library". > > I think everybody whant that Ada standard containers should be safe. During the container library design process, the ARG was *very* concerned about safety. This library has many more checks than you get in the C++ STL, for example. You still don't seem to grok the idea that safety, efficiency, and flexibility are in tension. You can't optimize for all three simultaneously, so you have to make a choice about how efficient vs. how safe.