Boost logo

Boost Users :

Subject: Re: [Boost-users] [Serialization / 1.58] wrong number of entries in std::vector<boost::tuple<double, double, double> >
From: Robert Ramey (ramey_at_[hidden])
Date: 2015-04-20 17:22:44


Ruediger Berlich-3 wrote
> Hi,
>
> I’ve just installed Boost 1.58 and ran into the following problem: I have
> a class with a std::vector&lt;boost::tuple&lt;double, double, double&gt;
> >, that is supposed to always have at least one entry, but may have more.
> Hence, in the default constructor, I initialize the std::vector with one
> entry. The class is also serializable. Up until Boost 1.57, a
> de-serialized object always had the correct number of entries in the
> vector. As of 1.58, I am getting one entry too much, which probably means
> that Boost.Serialization simply attaches entries to the vector of a
> default-constructed class, but doesn’t clear it first. This happens in
> C++11-Mode, both on Ubuntu 14.10 (gcc 4.9.1) as well as on MacOS X
> Yosemite . It DOES NOT happen with a std::vector
> <double>
> . Below is a full test case that replicates the problem in a simplified
> environment.
>
> For Boost 1.57 the program returns:
>
> t_vec.size() = 1
> t_vec2.size() = 1
>
> For Boost 1.58 the answer is
>
> t_vec.size() = 1
> t_vec2.size() = 2
>
> Best Regards,
> Beet

ouch! - make a trac item for this!

Robert Ramey

--
View this message in context: http://boost.2283326.n4.nabble.com/Serialization-1-58-wrong-number-of-entries-in-std-vector-boost-tuple-double-double-double-tp4674601p4674632.html
Sent from the Boost - Users mailing list archive at Nabble.com.

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