1 #ifndef BOOST_SERIALIZATION_UNORDERED_COLLECTIONS_SAVE_IMP_HPP
2 #define BOOST_SERIALIZATION_UNORDERED_COLLECTIONS_SAVE_IMP_HPP
5 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
21 #include <boost/config.hpp>
22 #include <boost/serialization/nvp.hpp>
23 #include <boost/serialization/serialization.hpp>
24 #include <boost/serialization/version.hpp>
25 #include <boost/serialization/collection_size_type.hpp>
26 #include <boost/serialization/item_version_type.hpp>
29 namespace serialization {
36 template<
class Archive,
class Container>
37 inline void save_unordered_collection(Archive & ar,
const Container &s)
39 collection_size_type count(s.size());
40 const collection_size_type bucket_count(s.bucket_count());
41 const item_version_type item_version(
42 version<BOOST_DEDUCED_TYPENAME Container::value_type>::value
49 boost::archive::library_version_type library_version(
50 ar.get_library_version()
53 ar << BOOST_SERIALIZATION_NVP(count);
54 ar << BOOST_SERIALIZATION_NVP(bucket_count);
55 if(boost::archive::library_version_type(3) < library_version){
59 ar << BOOST_SERIALIZATION_NVP(item_version);
62 ar << BOOST_SERIALIZATION_NVP(count);
63 ar << BOOST_SERIALIZATION_NVP(bucket_count);
64 ar << BOOST_SERIALIZATION_NVP(item_version);
67 BOOST_DEDUCED_TYPENAME Container::const_iterator it = s.begin();
70 boost::serialization::save_construct_data_adl(
73 boost::serialization::version<
74 BOOST_DEDUCED_TYPENAME Container::value_type
77 ar << boost::serialization::make_nvp(
"item", *it++);
85 #endif //BOOST_SERIALIZATION_UNORDERED_COLLECTIONS_SAVE_IMP_HPP