fix doc example typo
[boost.git] / boost / serialization / hash_set.hpp
blob62aeea46017fa7debca9dba7434441ed3cc553f3
1 #ifndef BOOST_SERIALIZATION_HASH_SET_HPP
2 #define BOOST_SERIALIZATION_HASH_SET_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 // hash_set.hpp: serialization for stl hash_set 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.
19 #include <boost/config.hpp>
20 #ifdef BOOST_HAS_HASH
21 #include BOOST_HASH_SET_HEADER
23 #include <boost/serialization/hash_collections_save_imp.hpp>
24 #include <boost/serialization/hash_collections_load_imp.hpp>
25 #include <boost/serialization/split_free.hpp>
27 namespace boost {
28 namespace serialization {
30 template<
31 class Archive,
32 class Key,
33 class HashFcn,
34 class EqualKey,
35 class Allocator
37 inline void save(
38 Archive & ar,
39 const BOOST_STD_EXTENSION_NAMESPACE::hash_set<
40 Key, HashFcn, EqualKey, Allocator
41 > &t,
42 const unsigned int file_version
44 boost::serialization::stl::save_hash_collection<
45 Archive,
46 BOOST_STD_EXTENSION_NAMESPACE::hash_set<
47 Key, HashFcn, EqualKey, Allocator
49 >(ar, t);
52 template<
53 class Archive,
54 class Key,
55 class HashFcn,
56 class EqualKey,
57 class Allocator
59 inline void load(
60 Archive & ar,
61 BOOST_STD_EXTENSION_NAMESPACE::hash_set<
62 Key, HashFcn, EqualKey, Allocator
63 > &t,
64 const unsigned int file_version
66 boost::serialization::stl::load_hash_collection<
67 Archive,
68 BOOST_STD_EXTENSION_NAMESPACE::hash_set<
69 Key, HashFcn, EqualKey, Allocator
71 boost::serialization::stl::archive_input_set<
72 Archive,
73 BOOST_STD_EXTENSION_NAMESPACE::hash_set<
74 Key, HashFcn, EqualKey, Allocator
77 >(ar, t);
80 // split non-intrusive serialization function member into separate
81 // non intrusive save/load member functions
82 template<
83 class Archive,
84 class Key,
85 class HashFcn,
86 class EqualKey,
87 class Allocator
89 inline void serialize(
90 Archive & ar,
91 BOOST_STD_EXTENSION_NAMESPACE::hash_set<
92 Key, HashFcn, EqualKey, Allocator
93 > &t,
94 const unsigned int file_version
96 boost::serialization::split_free(ar, t, file_version);
99 // hash_multiset
100 template<
101 class Archive,
102 class Key,
103 class HashFcn,
104 class EqualKey,
105 class Allocator
107 inline void save(
108 Archive & ar,
109 const BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
110 Key, HashFcn, EqualKey, Allocator
111 > &t,
112 const unsigned int file_version
114 boost::serialization::stl::save_hash_collection<
115 Archive,
116 BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
117 Key, HashFcn, EqualKey, Allocator
119 >(ar, t);
122 template<
123 class Archive,
124 class Key,
125 class HashFcn,
126 class EqualKey,
127 class Allocator
129 inline void load(
130 Archive & ar,
131 BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
132 Key, HashFcn, EqualKey, Allocator
133 > &t,
134 const unsigned int file_version
136 boost::serialization::stl::load_hash_collection<
137 Archive,
138 BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
139 Key, HashFcn, EqualKey, Allocator
141 boost::serialization::stl::archive_input_multiset<
142 Archive,
143 BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
144 Key, HashFcn, EqualKey, Allocator
147 >(ar, t);
150 // split non-intrusive serialization function member into separate
151 // non intrusive save/load member functions
152 template<
153 class Archive,
154 class Key,
155 class HashFcn,
156 class EqualKey,
157 class Allocator
159 inline void serialize(
160 Archive & ar,
161 BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
162 Key, HashFcn, EqualKey, Allocator
163 > & t,
164 const unsigned int file_version
166 boost::serialization::split_free(ar, t, file_version);
169 } // namespace serialization
170 } // namespace boost
172 #include <boost/serialization/collection_traits.hpp>
174 BOOST_SERIALIZATION_COLLECTION_TRAITS(BOOST_STD_EXTENSION_NAMESPACE::hash_set)
175 BOOST_SERIALIZATION_COLLECTION_TRAITS(BOOST_STD_EXTENSION_NAMESPACE::hash_multiset)
177 #endif // BOOST_HAS_HASH
178 #endif // BOOST_SERIALIZATION_HASH_SET_HPP