comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Ada Containers
Date: Sun, 07 Oct 2012 23:00:21 +0100
Date: 2012-10-07T23:00:21+01:00	[thread overview]
Message-ID: <m2d30u2b9m.fsf@pushface.org> (raw)
In-Reply-To: 7bff0fc1-d670-4225-aa4f-282d80934a5b@googlegroups.com

rwilco19@gmail.com writes:

> Can someone please explain to me the difference between
> Ada.Containers.Hashed_Tables and Ada.Containers.Hashed_Maps, and when
> you might want to use a Hashed_Table over a Hashed_Map?

Ada.Containers.Hash_Tables, as you noted.

Hashed_Maps is in the Standard, Hash_Tables is not; it's part of
AdaCore's implementation (and maybe others, for all I know).

GCC 4.7.0 says for Hashed_Maps

   with Ada.Iterator_Interfaces;

   private with Ada.Containers.Hash_Tables;
   private with Ada.Finalization;
   private with Ada.Streams;

   generic
      type Key_Type is private;
      type Element_Type is private;

      with function Hash (Key : Key_Type) return Hash_Type;
      with function Equivalent_Keys (Left, Right : Key_Type) return Boolean;
      with function "=" (Left, Right : Element_Type) return Boolean is <>;

   package Ada.Containers.Hashed_Maps is

and you will see that Hash_Tables is withed privately (i.e., it's only
used in the private part, "not specified by the language").

A further clue: the comment at the start of Hash_Tables says "This
package declares the hash-table type used to implement hashed
containers."



      parent reply	other threads:[~2012-10-16  1:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-07 19:58 Ada Containers rwilco19
2012-10-07 20:40 ` Maciej Sobczak
2012-10-07 21:25   ` rwilco19
2012-10-11 18:31     ` Martin
2012-10-12 10:35       ` georg bauhaus
2012-10-07 21:30   ` rwilco19
2012-10-07 21:56     ` Georg Bauhaus
2012-10-07 22:00 ` Simon Wright [this message]
replies disabled

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