Boost logo

Boost Users :

Subject: [Boost-users] Is MultiIndex right for me?
From: Sensei (senseiwa_at_[hidden])
Date: 2013-07-22 10:42:05


Hello everyone,

I was playing with std::unordered_multimap trying to achieve the following.

I need to store values in no particular order. I need to find, however,
all values (let's assume they are integers) that satisfy some given
criteria that is NOT the simple equality.

For example, I'd like to store integers, and find all integers that are
equal modulo p, for instance given two integers u, v, I may write the
equality predicate as return (u % p) == (v % p).

This requirement might change (at compile time, of course), for example,
in another map I'd like to find all integers that have a particular bit
set to 1.

I tried, as I said, with std::unordered_multimap, but I was told
(correctly, AFAIK) that the ISO requires that items matching values MUST
match also with hash values.

Of course, in my case matching integers do not possess matching hashes.

I was wondering if boost might be handy here.

Thanks & Cheers!


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