Boost logo

Boost Users :

Subject: Re: [Boost-users] How to best use unordered_set or unordered_map to hold small array(s) of ints
From: OvermindDL1 (overminddl1_at_[hidden])
Date: 2010-08-20 18:20:00


On Fri, Aug 20, 2010 at 12:58 PM, B Hart <bhartsb_at_[hidden]> wrote:
> I posted this last night, but not sure it went through to the list as I
> don't see it in my sent items and I never got any responses.  Sorry if it is
> duplicate.
>
> I'm hoping someone could offer an example or advice on how to best use
> unordered_set or unordered_map to hold many small arrays of unsigned
> integers.
> I would like to use the built in hash function rather than have to create
> one.  Also, since I have many of these small arrays, keeping the memory
> footprint small and the hash time at a minimum are important concerns.
>
> A typical int array would hold 5 unsigned ints.
>
> Maybe someone could offer example code or suggestions.  The samples I see
> are always the trivial case of just entering a single number or string as
> key or value.

Whether using a C array, boost::array, std::vector, whatever, you will
need to create your own hash function as the default one does not
support those by default.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net