fix doc example typo
[boost.git] / boost / ptr_container / serialize_ptr_vector.hpp
bloba25066a8e871562aa139a0abc2ed4b4acb861d66
1 // Copyright Sebastian Ramacher, 2007.
2 // Distributed under the Boost Software License, Version 1.0. (See
3 // accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 #ifndef BOOST_PTR_CONTAINER_SERIALIZE_PTR_VECTOR_HPP
7 #define BOOST_PTR_CONTAINER_SERIALIZE_PTR_VECTOR_HPP
9 #include <boost/ptr_container/detail/serialize_reversible_cont.hpp>
10 #include <boost/ptr_container/ptr_vector.hpp>
12 namespace boost
15 namespace serialization
18 template<class Archive, class T, class CloneAllocator, class Allocator>
19 void load(Archive& ar, ptr_vector<T, CloneAllocator, Allocator>& c, unsigned int /*version*/)
21 typedef ptr_vector<T, CloneAllocator, Allocator> container_type;
22 typedef BOOST_DEDUCED_TYPENAME container_type::size_type size_type;
24 size_type n;
25 ar >> boost::serialization::make_nvp( ptr_container_detail::count(), n );
26 c.reserve(n);
28 ptr_container_detail::load_helper(ar, c, n);
31 template<class Archive, class T, class CloneAllocator, class Allocator>
32 void serialize(Archive& ar, ptr_vector<T, CloneAllocator, Allocator>& c, const unsigned int version)
34 split_free(ar, c, version);
37 } // namespace serialization
38 } // namespace boost
40 #endif