Boost logo

Boost Users :

Subject: [Boost-users] Serializing containers of movable but noncopyable types
From: Daniel Mitchell (dlm.bulk.messages_at_[hidden])
Date: 2013-07-01 09:38:51


While attempting to serialize a std::vector<T>, where T is a movable but noncopyable type, I was getting blown up by the call to s.push_back() on line 65 of collections_load_imp.hpp (Boost 1.53.0).

In my local copy of that header I changed s.push_back(t.reference()) to s.push_back(std::move(t.reference())). Is this a safe change? Is there a better way to handle this case?


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