Subject: [Boost-bugs] [Boost C++ Libraries] #11612: serializing vector
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-09-02 13:09:50
#11612: serializing vector
-------------------------------+---------------------------
Reporter: thetetrismaster@⦠| Owner: ramey
Type: Bugs | Status: new
Milestone: To Be Determined | Component: serialization
Version: Boost 1.58.0 | Severity: Problem
Keywords: vector |
-------------------------------+---------------------------
In <boost/serialization/vector.hpp>
when dispatching to the default load method and
detail::is_default_constructible<U> fails, should the vector be cleared if
it is not empty? line 98 reserves capacity for the vector and line 102
pushes new elements into the vector. so if the vector is loaded multiple
times its size will grow. if you try to load a vector starting with a
vector that is not empty, the vector size will grow.
should you do the following check:
if(!t.empty()) t.clear();
t.reserve(count);
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11612> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC