1 #ifndef BOOST_SERIALIZATION_UNORDERED_MAP_HPP
2 #define BOOST_SERIALIZATION_UNORDERED_MAP_HPP
5 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
20 #include <tr1/unordered_map>
22 #include <boost/config.hpp>
24 #include <boost/serialization/utility.hpp>
25 #include <boost/serialization/unordered_collections_save_imp.hpp>
26 #include <boost/serialization/unordered_collections_load_imp.hpp>
27 #include <boost/serialization/split_free.hpp>
30 namespace serialization {
35 template<
class Archive,
class Container>
36 struct archive_input_unordered_map
38 inline void operator()(
43 typedef BOOST_DEDUCED_TYPENAME Container::value_type type;
44 detail::stack_construct<Archive, type> t(ar, v);
46 ar >> boost::serialization::make_nvp(
"item", t.reference());
47 std::pair<BOOST_DEDUCED_TYPENAME Container::const_iterator, bool> result =
48 s.insert(t.reference());
53 ar.reset_object_address(
54 & (result.first->second),
55 & t.reference().second
62 template<
class Archive,
class Container>
63 struct archive_input_unordered_multimap
65 inline void operator()(
70 typedef BOOST_DEDUCED_TYPENAME Container::value_type type;
71 detail::stack_construct<Archive, type> t(ar, v);
73 ar >> boost::serialization::make_nvp(
"item", t.reference());
74 BOOST_DEDUCED_TYPENAME Container::const_iterator result
75 = s.insert(t.reference());
79 ar.reset_object_address(
97 const std::tr1::unordered_map<
98 Key, HashFcn, EqualKey, Allocator
102 boost::serialization::stl::save_unordered_collection<
104 std::tr1::unordered_map<
105 Key, HashFcn, EqualKey, Allocator
119 std::tr1::unordered_map<
120 Key, HashFcn, EqualKey, Allocator
124 boost::serialization::stl::load_unordered_collection<
126 std::tr1::unordered_map<
127 Key, HashFcn, EqualKey, Allocator
129 boost::serialization::stl::archive_input_unordered_map<
131 std::tr1::unordered_map<
132 Key, HashFcn, EqualKey, Allocator
147 inline void serialize(
149 std::tr1::unordered_map<
150 Key, HashFcn, EqualKey, Allocator
152 const unsigned int file_version
154 boost::serialization::split_free(ar, t, file_version);
167 const std::tr1::unordered_multimap<
168 Key, HashFcn, EqualKey, Allocator
172 boost::serialization::stl::save_unordered_collection<
174 std::tr1::unordered_multimap<
175 Key, HashFcn, EqualKey, Allocator
189 std::tr1::unordered_multimap<
190 Key, HashFcn, EqualKey, Allocator
194 boost::serialization::stl::load_unordered_collection<
196 std::tr1::unordered_multimap<
197 Key, HashFcn, EqualKey, Allocator
199 boost::serialization::stl::archive_input_unordered_multimap<
201 std::tr1::unordered_multimap<
202 Key, HashFcn, EqualKey, Allocator
217 inline void serialize(
219 std::tr1::unordered_multimap<
220 Key, HashFcn, EqualKey, Allocator
222 const unsigned int file_version
224 boost::serialization::split_free(ar, t, file_version);
230 #endif // BOOST_SERIALIZATION_UNORDERED_MAP_HPP