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!postnews.google.com!g47g2000cwa.googlegroups.com!not-for-mail From: "MMM" Newsgroups: comp.lang.ada Subject: Re: GCC 4.0 Ada.Containers Cursor danger. Date: 12 Jul 2005 21:16:00 -0700 Organization: http://groups.google.com Message-ID: <1121228160.445437.171480@g47g2000cwa.googlegroups.com> References: <42cd064c$0$10817$9b4e6d93@newsread4.arcor-online.net> <42cda8c4$0$22780$9b4e6d93@newsread2.arcor-online.net> <1u3hh2597i4ne$.1ryetugksbmus.dlg@40tude.net> <1121093807.949660.274060@g44g2000cwa.googlegroups.com> <1121124248.600055.292320@f14g2000cwb.googlegroups.com> <1121137531.752285.44280@g44g2000cwa.googlegroups.com> <946e7$42d3c64d$4995421$28449@ALLTEL.NET> <1121179909.262566.192270@o13g2000cwo.googlegroups.com> <5a73f$42d40166$4995149$5993@ALLTEL.NET> <1121194262.036046.38230@g49g2000cwa.googlegroups.com> <1121195712.513120.70330@g43g2000cwa.googlegroups.com> <1121198441.766238.303580@o13g2000cwo.googlegroups.com> NNTP-Posting-Host: 24.107.234.224 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1121228165 28893 127.0.0.1 (13 Jul 2005 04:16:05 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 13 Jul 2005 04:16:05 +0000 (UTC) In-Reply-To: User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: g47g2000cwa.googlegroups.com; posting-host=24.107.234.224; posting-account=0PrGnQwAAAAhG4fw_pPdaColajHpyOJW Xref: g2news1.google.com comp.lang.ada:3612 Date: 2005-07-12T21:16:00-07:00 List-Id: Randy Brukardt wrote: > > Because a hash implementation is impossible for Ada unless you make it > visible to the user (by passing a hash function as a generic parameter). At > which point it is no longer unordered, it has turned into an "unspecified That is not correct in general. That is correct if you explicitly require order preserving hash function. See for example http://www.nist.gov/dads/HTML/orderpresmph.html In general order is implementation dependent and in some cases depends on insertion order. > ordered" container. As a practical matter, a hashed container is much harder > for the user to use than an ordered one. (An ordered one always will work Use an ordered one then - list or vector. > with reasonable time complexity; a hashed one is very sensitive to the That depends on the task at hand of course. > quality of the hash function. Writing a good hash function is an art, not a > science, and often the best answer is not obvious. I always run tests for > various hash functions on sample data, and that is not practical for the Q&D > uses that containers are best suited for.) > > Randy. > Mikhail