fix doc example typo
[boost.git] / boost / serialization / map.hpp
blob6cf965ff8b1d0e3f1ad17d908c9e39575275ffb1
1 #ifndef BOOST_SERIALIZATION_MAP_HPP
2 #define BOOST_SERIALIZATION_MAP_HPP
4 // MS compatible compilers support #pragma once
5 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
6 # pragma once
7 #endif
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10 // serialization/map.hpp:
11 // serialization for stl map templates
13 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
14 // Use, modification and distribution is subject to the Boost Software
15 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
16 // http://www.boost.org/LICENSE_1_0.txt)
18 // See http://www.boost.org for updates, documentation, and revision history.
20 #include <map>
22 #include <boost/config.hpp>
24 #include <boost/serialization/utility.hpp>
25 #include <boost/serialization/collections_save_imp.hpp>
26 #include <boost/serialization/collections_load_imp.hpp>
27 #include <boost/serialization/split_free.hpp>
29 namespace boost {
30 namespace serialization {
32 template<class Archive, class Type, class Key, class Compare, class Allocator >
33 inline void save(
34 Archive & ar,
35 const std::map<Key, Type, Compare, Allocator> &t,
36 const unsigned int /* file_version */
38 boost::serialization::stl::save_collection<
39 Archive,
40 std::map<Key, Type, Compare, Allocator>
41 >(ar, t);
44 template<class Archive, class Type, class Key, class Compare, class Allocator >
45 inline void load(
46 Archive & ar,
47 std::map<Key, Type, Compare, Allocator> &t,
48 const unsigned int /* file_version */
50 boost::serialization::stl::load_collection<
51 Archive,
52 std::map<Key, Type, Compare, Allocator>,
53 boost::serialization::stl::archive_input_map<
54 Archive, std::map<Key, Type, Compare, Allocator> >,
55 boost::serialization::stl::no_reserve_imp<std::map<
56 Key, Type, Compare, Allocator
59 >(ar, t);
62 // split non-intrusive serialization function member into separate
63 // non intrusive save/load member functions
64 template<class Archive, class Type, class Key, class Compare, class Allocator >
65 inline void serialize(
66 Archive & ar,
67 std::map<Key, Type, Compare, Allocator> &t,
68 const unsigned int file_version
70 boost::serialization::split_free(ar, t, file_version);
73 // multimap
74 template<class Archive, class Type, class Key, class Compare, class Allocator >
75 inline void save(
76 Archive & ar,
77 const std::multimap<Key, Type, Compare, Allocator> &t,
78 const unsigned int /* file_version */
80 boost::serialization::stl::save_collection<
81 Archive,
82 std::multimap<Key, Type, Compare, Allocator>
83 >(ar, t);
86 template<class Archive, class Type, class Key, class Compare, class Allocator >
87 inline void load(
88 Archive & ar,
89 std::multimap<Key, Type, Compare, Allocator> &t,
90 const unsigned int /* file_version */
92 boost::serialization::stl::load_collection<
93 Archive,
94 std::multimap<Key, Type, Compare, Allocator>,
95 boost::serialization::stl::archive_input_multimap<
96 Archive, std::multimap<Key, Type, Compare, Allocator>
98 boost::serialization::stl::no_reserve_imp<
99 std::multimap<Key, Type, Compare, Allocator>
101 >(ar, t);
104 // split non-intrusive serialization function member into separate
105 // non intrusive save/load member functions
106 template<class Archive, class Type, class Key, class Compare, class Allocator >
107 inline void serialize(
108 Archive & ar,
109 std::multimap<Key, Type, Compare, Allocator> &t,
110 const unsigned int file_version
112 boost::serialization::split_free(ar, t, file_version);
115 } // serialization
116 } // namespace boost
118 #endif // BOOST_SERIALIZATION_MAP_HPP