Boost logo

Boost Users :

Subject: Re: [Boost-users] [MultiIndex] Indexing integers
From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2014-07-30 11:17:19


Sensei <senseiwa <at> gmail.com> writes:

>
> On 7/29/14, 5:53 PM, Joaquin M Lopez Munoz wrote:
> > I think you need to write
> >
> > byHashedIndex &p = multiIndex_.template get<3>();
> >
> > (note the extra "template"). You might want to check the excellent
> > explanation on templates and dependent names given at
> > http://tinyurl.com/cmlqhcr .
>
> Thanks as always Joaquin, this solves the compilation error.
>
> I might have misunderstood how hashed indices work, because I don't know
> if multi index is suitable for fast retrieval of, for instance, all
> 128-bit integers that have MSB equal to 3? Something akin to a simple
> std::unordered_multimap with better storage?

Absolutely. The interface of hashed indices is modelled upon that of
C++ unordered associative containers. equal_range(3) (on the MSB index)
will get you the elements you're after.

Joaquín M López Muñoz
Telefonica


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