Boost logo

Boost Users :

Subject: Re: [Boost-users] [Interprocess] updating elements in vector of maps fails in optimized code
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2011-05-12 16:14:07


El 12/05/2011 12:23, Steven Maenhout escribió:
> I just tried the latest trunk code and I'm sorry to report that the GCC
> specific attribute does not solve all problems. The crashes or
> indefinite waits have been resolved though.

Code is wrong, because allocator must be defined as:

typedef std::pair<const int,double> MapValue_t;

instead of

typedef std::pair<const int,double> MapValue_t;

usual map declaration is:

template < class Key, class T, class Compare = less<Key>,
            class Allocator = allocator<pair<const Key,T> > > class map;

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.

I hope this helps,

Ion


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