Boost logo

Boost Users :

Subject: Re: [Boost-users] [Interprocess] updating elements in vector of maps fails in optimized code
From: Steven Maenhout (Steven.Maenhout_at_[hidden])
Date: 2011-05-13 02:43:55


> Code is wrong, because allocator must be defined as:
>
> typedef std::pair<const int,double> MapValue_t;

Indeed that resolves the issues I encountered in the trunk code.

> The sad part is that I think this bug should have been detected by the
> implementation, since it's quite common, and it's curious everything
> compiled fine with such type change.

well I did ignore the following compilation warning:

boost-trunk/boost/interprocess/containers/container/detail/tree.hpp:328:31:
warning: returning reference to temporary

which does not occur when using the correct "const key" allocator.

anyways, thank you very much for your help,

Steven


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