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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ce306343df782d85 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Newbie - HashMap! Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1111061037.535775.69180@l41g2000cwc.googlegroups.com> Date: Thu, 17 Mar 2005 15:59:45 +0100 Message-ID: <1by6cbkqeexvc$.1l78w0ydrs9jd$.dlg@40tude.net> NNTP-Posting-Date: 17 Mar 2005 15:56:12 MET NNTP-Posting-Host: f85898ba.newsread4.arcor-online.net X-Trace: DXC=S3I^I^VhTk0LL2:TY8[@n6:ejgIfPPld4jW\KbG]kaM8GSi?jHD8GO0DQUX2H;?^^7[6LHn;2LCV>7enW;^6ZC`4<=9bOTW=MN> X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:9547 Date: 2005-03-17T15:56:12+01:00 List-Id: On 17 Mar 2005 04:03:57 -0800, fphsml@gmail.com wrote: > What is the equivalent of the following C++ STL code? > > hash_map hm; > hm["key"] = "value"; > > I saw a sample at > http://www.adapower.com/index.php?Command=Class&ClassID=GNAT&CID=240 > which looks scary. > > I just need simple key lookup. Which library should I use? If that scares you (I don't know why, maybe because of unbounded strings?) then you could try: http://www.dmitry-kazakov.de/ada/tables.htm It uses plain string keys (though it's implementation is not a hash). However, unbounded strings (or pointers to strings) will be needed anyway on the "values" side. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de