Boost logo

Boost Users :

Subject: Re: [Boost-users] Using unordered_set or unordered_map to hold small array(s) of ints
From: B Hart (bhartsb_at_[hidden])
Date: 2010-08-20 18:07:35

Just a comparison function? How is, for example, unordered set going to
know the end of the array, to hash it? I don't know what is happening
under-the-hood so I'm deferring to the list experts.

Can you give me a simple example?

On Fri, Aug 20, 2010 at 4:31 AM, OvermindDL1 <overminddl1_at_[hidden]> wrote:

> On Fri, Aug 20, 2010 at 2:21 AM, B Hart <bhartsb_at_[hidden]> wrote:
> > Can someone please provide an example of how to best use
> unordered_map/set
> > to store/lookup many small arrays of integers. e.g. unsigned int I[5] =
> > {1000,3344455,12455222,8832232};
> > I'm guessing that there is no facility for using raw C++ arrays, and that
> > one must wrap them in a struct.
> I guess you mean C arrays and not C++ arrays as C++ arrays are
> probably std::vector's.
> C arrays or C++ vectors would work fine though, but you would need to
> supply your own comparison function, and if C arrays add an ending tag
> like zero or have a static length.
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at