fix doc example typo
[boost.git] / boost / serialization / hash_map.hpp
blob06d4c306dc1aaf99d408a1f8eee53f5caeef25e5
1 #ifndef BOOST_SERIALIZATION_HASH_MAP_HPP
2 #define BOOST_SERIALIZATION_HASH_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/hash_map.hpp:
11 // serialization for stl hash_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 <boost/config.hpp>
21 #ifdef BOOST_HAS_HASH
22 #include BOOST_HASH_MAP_HEADER
24 #include <boost/serialization/utility.hpp>
25 #include <boost/serialization/hash_collections_save_imp.hpp>
26 #include <boost/serialization/hash_collections_load_imp.hpp>
27 #include <boost/serialization/split_free.hpp>
29 namespace boost {
30 namespace serialization {
32 template<
33 class Archive,
34 class Key,
35 class HashFcn,
36 class EqualKey,
37 class Allocator
39 inline void save(
40 Archive & ar,
41 const BOOST_STD_EXTENSION_NAMESPACE::hash_map<
42 Key, HashFcn, EqualKey, Allocator
43 > &t,
44 const unsigned int file_version
46 boost::serialization::stl::save_hash_collection<
47 Archive,
48 BOOST_STD_EXTENSION_NAMESPACE::hash_map<
49 Key, HashFcn, EqualKey, Allocator
51 >(ar, t);
54 template<
55 class Archive,
56 class Key,
57 class HashFcn,
58 class EqualKey,
59 class Allocator
61 inline void load(
62 Archive & ar,
63 BOOST_STD_EXTENSION_NAMESPACE::hash_map<
64 Key, HashFcn, EqualKey, Allocator
65 > &t,
66 const unsigned int file_version
68 boost::serialization::stl::load_hash_collection<
69 Archive,
70 BOOST_STD_EXTENSION_NAMESPACE::hash_map<
71 Key, HashFcn, EqualKey, Allocator
73 boost::serialization::stl::archive_input_map<
74 Archive,
75 BOOST_STD_EXTENSION_NAMESPACE::hash_map<
76 Key, HashFcn, EqualKey, Allocator
79 >(ar, t);
82 // split non-intrusive serialization function member into separate
83 // non intrusive save/load member functions
84 template<
85 class Archive,
86 class Key,
87 class HashFcn,
88 class EqualKey,
89 class Allocator
91 inline void serialize(
92 Archive & ar,
93 BOOST_STD_EXTENSION_NAMESPACE::hash_map<
94 Key, HashFcn, EqualKey, Allocator
95 > &t,
96 const unsigned int file_version
98 boost::serialization::split_free(ar, t, file_version);
101 // hash_multimap
102 template<
103 class Archive,
104 class Key,
105 class HashFcn,
106 class EqualKey,
107 class Allocator
109 inline void save(
110 Archive & ar,
111 const BOOST_STD_EXTENSION_NAMESPACE::hash_multimap<
112 Key, HashFcn, EqualKey, Allocator
113 > &t,
114 const unsigned int file_version
116 boost::serialization::stl::save_hash_collection<
117 Archive,
118 BOOST_STD_EXTENSION_NAMESPACE::hash_multimap<
119 Key, HashFcn, EqualKey, Allocator
121 >(ar, t);
124 template<
125 class Archive,
126 class Key,
127 class HashFcn,
128 class EqualKey,
129 class Allocator
131 inline void load(
132 Archive & ar,
133 BOOST_STD_EXTENSION_NAMESPACE::hash_multimap<
134 Key, HashFcn, EqualKey, Allocator
135 > &t,
136 const unsigned int file_version
138 boost::serialization::stl::load_hash_collection<
139 Archive,
140 BOOST_STD_EXTENSION_NAMESPACE::hash_multimap<
141 Key, HashFcn, EqualKey, Allocator
143 boost::serialization::stl::archive_input_multimap<
144 Archive,
145 BOOST_STD_EXTENSION_NAMESPACE::hash_multimap<
146 Key, HashFcn, EqualKey, Allocator
149 >(ar, t);
152 // split non-intrusive serialization function member into separate
153 // non intrusive save/load member functions
154 template<
155 class Archive,
156 class Key,
157 class HashFcn,
158 class EqualKey,
159 class Allocator
161 inline void serialize(
162 Archive & ar,
163 BOOST_STD_EXTENSION_NAMESPACE::hash_multimap<
164 Key, HashFcn, EqualKey, Allocator
165 > &t,
166 const unsigned int file_version
168 boost::serialization::split_free(ar, t, file_version);
171 } // namespace serialization
172 } // namespace boost
174 #endif // BOOST_HAS_HASH
175 #endif // BOOST_SERIALIZATION_HASH_MAP_HPP