comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <bauhaus@futureapps.de>
Subject: Re: Newbie - HashMap!
Date: Thu, 17 Mar 2005 16:19:17 +0100
Date: 2005-03-17T16:16:49+01:00	[thread overview]
Message-ID: <42399f5c$0$26540$9b4e6d93@newsread4.arcor-online.net> (raw)
In-Reply-To: <1111061037.535775.69180@l41g2000cwc.googlegroups.com>

fphsml@gmail.com wrote:
> What is the equivalent of the following C++ STL code?
> 
> hash_map<string, string> hm;
> hm["key"] = "value";

Has the hash_map already made it into the C++ STL?
I thought it was an extension to be included later?

Anyway,

   package Lookup_tables is
      new Ada.Containers.Hashed_Maps (Unbounded_String,
                                      Unbounded_String,
                                      Equivalent_Keys => "=",
                                      Hash => Hash);

procedure ex is

   use Lookup_Tables;

   hm: Map;
begin
   hm.insert(To_Unbounded_String("key"), To_Unbounded_String("value"));
end ex;



  parent reply	other threads:[~2005-03-17 15:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-17 12:03 Newbie - HashMap! fphsml
2005-03-17 14:59 ` Dmitry A. Kazakov
2005-03-18 16:02   ` fphsml
2005-03-17 15:19 ` Georg Bauhaus [this message]
2005-03-17 16:42   ` Martin Dowie
2005-03-21  0:33   ` Matthew Heaney
2005-03-21  0:19 ` Matthew Heaney
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox