On Sun, 22 Aug 2010 17:05:21 +0300, "Juha Manninen (gmail)"
<juha.mannine...@gmail.com> wrote:
> Hi
> 
> Is there an implementation of a hash map where the keys are integers. It
> is 
> needed when the integers are too big for a lookup array.
> I only need check the existence of keys so the data type is not
important.
> About like this:

uses fgl;

type
  TIntMap = specialize TFPGMap<Integer, Integer>; //Maps Int --> Int

> var
>   Len: integer;
>   SeenLen: TIntMap; // or whatever the type is called
> 
>   ...
> 
>   if not SeenLen.Has(Len) then begin
>     ... work with Len ...
>     SeenLen[Len] := nil;  // If the data type is pointer
>   end;
> 
> 
> A related question:
> What is the state of the generic containers now?

FPC 2.4.x should be fine with generics, although 2.5 is still more
advanced in that sector.

Best regards,
Andreas.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to