Update contrib.
1 #ifndef BOOST_SERIALIZATION_VECTOR_HPP
2 #define BOOST_SERIALIZATION_VECTOR_HPP
4 // MS compatible compilers support #pragma once
5 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10 // vector.hpp: serialization for stl vector templates
12 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
13 // Use, modification and distribution is subject to the Boost Software
14 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
15 // http://www.boost.org/LICENSE_1_0.txt)
17 // See http://www.boost.org for updates, documentation, and revision history.
21 #include <boost/config.hpp>
22 #include <boost/detail/workaround.hpp>
24 #include <boost/serialization/collections_save_imp.hpp>
25 #include <boost/serialization/collections_load_imp.hpp>
26 #include <boost/serialization/split_free.hpp>
29 namespace serialization {
31 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
33 template<class Archive, class U, class Allocator>
36 const std::vector<U, Allocator> &t,
37 const unsigned int /* file_version */
39 boost::serialization::stl::save_collection<Archive, std::vector<U, Allocator> >(
44 template<class Archive, class U, class Allocator>
47 std::vector<U, Allocator> &t,
48 const unsigned int /* file_version */
50 boost::serialization::stl::load_collection<
52 std::vector<U, Allocator>,
53 boost::serialization::stl::archive_input_seq<
54 Archive, std::vector<U, Allocator>
56 boost::serialization::stl::reserve_imp<std::vector<U, Allocator> >
60 // split non-intrusive serialization function member into separate
61 // non intrusive save/load member functions
62 template<class Archive, class U, class Allocator>
63 inline void serialize(
65 std::vector<U, Allocator> & t,
66 const unsigned int file_version
68 boost::serialization::split_free(ar, t, file_version);
71 #if ! BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
73 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
75 template<class Archive, class Allocator>
78 const std::vector<bool, Allocator> &t,
79 const unsigned int /* file_version */
81 // record number of elements
82 unsigned int count = t.size();
83 ar << BOOST_SERIALIZATION_NVP(count);
84 std::vector<bool>::const_iterator it = t.begin();
87 ar << boost::serialization::make_nvp("item", tb);
91 template<class Archive, class Allocator>
94 std::vector<bool, Allocator> &t,
95 const unsigned int /* file_version */
97 // retrieve number of elements
99 ar >> BOOST_SERIALIZATION_NVP(count);
103 ar >> boost::serialization::make_nvp("item", i);
108 // split non-intrusive serialization function member into separate
109 // non intrusive save/load member functions
110 template<class Archive, class Allocator>
111 inline void serialize(
113 std::vector<bool, Allocator> & t,
114 const unsigned int file_version
116 boost::serialization::split_free(ar, t, file_version);
119 #endif // BOOST_WORKAROUND
124 #include <boost/serialization/collection_traits.hpp>
126 BOOST_SERIALIZATION_COLLECTION_TRAITS(std::vector)
128 #endif // BOOST_SERIALIZATION_VECTOR_HPP