Re: How to use associative arrays in Ada 2005?
- From: "snoopysalive" <matthias.kistler@xxxxxx>
- Date: 23 Nov 2006 11:27:31 -0800
Hi!
First: @Matt: Thank you for the pdf. It's really useful, but I couldn't
write you back because of the email filter.
And now, my next question: How to handle "hashes of hashes" in Ada?
Here's the code which should contain a package representing a hash of a
hash:
-- Here, the code begins
with Ada.Text_IO,
Ada.Strings.Hash,
Ada.Containers.Indefinite_Hashed_Maps;
use Ada.Text_IO,
Ada.Strings,
Ada.Containers;
procedure book is
package Str_Int_Maps is
new Ada.Containers.Indefinite_Hashed_Maps
(String,
Integer,
Ada.Strings.Hash,
"=");
use Str_Int_Maps;
package Str_Map_Maps is
new Ada.Containers.Indefinite_Hashed_Maps
(String,
Str_Int_Maps.Map,
Ada.Strings.Hash,
"=");
Ages : Str_Map_Maps.Map; -- That's the "hash of a hash"
begin
Ages.Insert("family name",Insert("name",23));
end book;
-- Here, the code ends
The statement "Ages.Insert("family name",Insert("name",23));" doesn't
work. So, how is it possible to do something like this in C++:
"...
map<string, map<string,int>> ages;
ages["family name"]["name"] = 23;
...."
Thank you and greetings,
Matthias
.
- Follow-Ups:
- Re: How to use associative arrays in Ada 2005?
- From: Matthew Heaney
- Re: How to use associative arrays in Ada 2005?
- From: Dmitry A. Kazakov
- Re: How to use associative arrays in Ada 2005?
- From: Georg Bauhaus
- Re: How to use associative arrays in Ada 2005?
- From: Georg Bauhaus
- Re: How to use associative arrays in Ada 2005?
- References:
- How to use associative arrays in Ada 2005?
- From: snoopysalive
- Re: How to use associative arrays in Ada 2005?
- From: Matthew Heaney
- Re: How to use associative arrays in Ada 2005?
- From: snoopysalive
- How to use associative arrays in Ada 2005?
- Prev by Date: Re: How to manage a system call inside Ada ?
- Next by Date: Re: How to use associative arrays in Ada 2005?
- Previous by thread: Re: How to use associative arrays in Ada 2005?
- Next by thread: Re: How to use associative arrays in Ada 2005?
- Index(es):
Relevant Pages
|
|