Mercurial > hg > vamp-build-and-test
diff DEPENDENCIES/generic/include/boost/serialization/deque.hpp @ 101:c530137014c0
Update Boost headers (1.58.0)
author | Chris Cannam |
---|---|
date | Mon, 07 Sep 2015 11:12:49 +0100 |
parents | 2665513ce2d3 |
children |
line wrap: on
line diff
--- a/DEPENDENCIES/generic/include/boost/serialization/deque.hpp Fri Sep 04 12:01:02 2015 +0100 +++ b/DEPENDENCIES/generic/include/boost/serialization/deque.hpp Mon Sep 07 11:12:49 2015 +0100 @@ -2,7 +2,7 @@ #define BOOST_SERIALIZATION_DEQUE_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) # pragma once #endif @@ -21,7 +21,8 @@ #include <boost/config.hpp> #include <boost/serialization/collections_save_imp.hpp> -#include <boost/serialization/collections_load_imp.hpp> +#include <boost/serialization/detail/stack_constructor.hpp> +#include <boost/serialization/detail/is_default_constructible.hpp> #include <boost/serialization/split_free.hpp> namespace boost { @@ -44,14 +45,33 @@ std::deque<U, Allocator> &t, const unsigned int /*file_version*/ ){ - boost::serialization::stl::load_collection< - Archive, - std::deque<U, Allocator>, - boost::serialization::stl::archive_input_seq< - Archive, std::deque<U, Allocator> - >, - boost::serialization::stl::no_reserve_imp<std::deque<U, Allocator> > - >(ar, t); + const boost::archive::library_version_type library_version( + ar.get_library_version() + ); + // retrieve number of elements + item_version_type item_version(0); + collection_size_type count; + ar >> BOOST_SERIALIZATION_NVP(count); + if(boost::archive::library_version_type(3) < library_version){ + ar >> BOOST_SERIALIZATION_NVP(item_version); + } + if(detail::is_default_constructible<U>()){ + t.resize(count); + typename std::deque<U, Allocator>::iterator hint; + hint = t.begin(); + while(count-- > 0){ + ar >> boost::serialization::make_nvp("item", *hint++); + } + } + else{ + t.clear(); + while(count-- > 0){ + detail::stack_construct<Archive, U> u(ar, item_version); + ar >> boost::serialization::make_nvp("item", u.reference()); + t.push_back(u.reference()); + ar.reset_object_address(& t.back() , & u.reference()); + } + } } // split non-intrusive serialization function member into separate