id summary reporter owner description type status milestone component version severity resolution keywords cc 2271 Cannot load version 1.35.0 xml archives that contain vectors of primitive types Ryan Mulder Matthias Troyer "Version 1.35.0 xml archives are missing the element in vectors of primitive types. This is obviously a known issue, because version 1.36.0 includes the compatibility header vector_135.hpp. The problem is, that even when vector_135.hpp is included, it makes no difference because the appropriate load method is not called. The load method in vector.hpp that is aware of the 1.35.0 bug is this: {{{ template inline void load( Archive & ar, std::vector &t, const unsigned int /* file_version */, mpl::true_ ){ collection_size_type count(t.size()); ar >> BOOST_SERIALIZATION_NVP(count); t.resize(count); unsigned int item_version=0; if(BOOST_SERIALIZATION_VECTOR_VERSION < ar.get_library_version()) ar >> BOOST_SERIALIZATION_NVP(item_version); if (!t.empty()) ar >> make_array(detail::get_data(t),t.size()); } }}} It works correctly, when called. The problem is that the load method which dispatches to either the default or the optimized version chooses the wrong version for vectors of primitive types. {{{ template inline void load( Archive & ar, std::vector &t, const unsigned int file_version ){ load(ar,t,file_version, BOOST_DEDUCED_TYPENAME use_array_optimization::template apply::type() ); } }}} For some reason, use_array_optimization does not work with primitive types. Version 1.35.0 used boost::detail::has_default_constructor() to dispatch. My patch changes the dispatching load method to this: {{{ template inline void load( Archive & ar, std::vector &t, const unsigned int file_version ){ if(BOOST_SERIALIZATION_VECTOR_VERSION < ar.get_library_version()) { load(ar,t,file_version, BOOST_DEDUCED_TYPENAME use_array_optimization::template apply::type() ); } else { load(ar,t,file_version, boost::detail::has_default_constructor() ); } } }}} It works well, but I do not fully why use_array_optimization did not work alone. I used a vector< unsigned char > as a test case." Patches closed Boost 1.37.0 serialization Boost 1.36.0 Problem fixed