Boost logo

Boost Users :

Subject: Re: [Boost-users] [MultiIndex] Indexing integers
From: Sensei (senseiwa_at_[hidden])
Date: 2014-07-31 11:27:44


On 7/31/14, 11:49am, Joaquin M Lopez Munoz wrote:
> Ok, never mind, the problem is this: lookup functions take *keys*, not
> whole values, so instead of
>
> auto q = p.equal_range(v);
>
> you have to write
>
> auto q = p.equal_range(MSB(v));
>
> The bug goes undetected at compile time because there's a default
> conversion from __uint128_t to uint64_t, but this conversion of course
> does not extract the MSB part, hence the run-time problems. In more
> usual scenarios where the key is a member of the element, the error
> would have been more apparent and the code wouldn't have compiled.

Thanks Joaquin, you're very clear and helpful!

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