Boost logo

Boost :

Subject: [boost] [container] stable_vector::back() is broken in Boost 1.53
From: Klaim - Joël Lamotte (mjklaim_at_[hidden])
Date: 2013-04-06 19:52:27


Tested on both VS2010 and VS2012,
boost 1.53,
with default boost no option set:

############

#include <boost/container/stable_vector.hpp>
#include <iostream>

int main()
{
boost::container::stable_vector< int > values;

values.emplace_back( 42 );
int& bad_value = values.back(); // bad address
int& good_value = values.front();
int& also_good_value = values.at(0); // imply values[0]

std::cout<< " ADDRESS OF BAD VALUE : " << &bad_value << std::endl;
std::cout<< " ADDRESS OF GOOD VALUE : " << &good_value << std::endl;
std::cout<< " ADDRESS OF ALSO GOOD VALUE : " << &also_good_value <<
std::endl;

}

############

This code displays addresses of the bad_value object very low on Debug and
very high on Release.
I believe that .back() is broken.
However, when I test there : http://liveworkspace.org/code/3F11CK$2
it seems to work with any available compiler.

So either it's LiveWorkspace which use an older boost version, or this
issue arise only on VC.

I made a ticket: https://svn.boost.org/trac/boost/ticket/8412

Joel Lamotte


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk