9 #ifndef IMPKERNEL_SET_MAP_MACROS_H
10 #define IMPKERNEL_SET_MAP_MACROS_H
15 #define IMP_KERNEL_SMALL_ORDERED_SET boost::container::flat_set
18 #define IMP_KERNEL_SMALL_ORDERED_MAP boost::container::flat_map
21 #define IMP_KERNEL_SMALL_UNORDERED_SET boost::container::flat_set
25 #define IMP_KERNEL_SMALL_UNORDERED_MAP boost::container::flat_map
28 #define IMP_KERNEL_LARGE_ORDERED_SET std::set
31 #define IMP_KERNEL_LARGE_ORDERED_MAP std::map
34 #define IMP_KERNEL_LARGE_UNORDERED_SET boost::unordered_set
38 #define IMP_KERNEL_LARGE_UNORDERED_MAP boost::unordered_map
42 #include <IMP/kernel_config.h>
43 #include <boost/version.hpp>
44 #include <boost/functional/hash/hash.hpp>
46 #include <boost/functional/hash/hash.hpp>
49 #include <boost/unordered_set.hpp>
50 #include <boost/unordered_map.hpp>
52 #define IMP_KERNEL_LARGE_ORDERED_SET std::set
53 #define IMP_KERNEL_LARGE_ORDERED_MAP std::map
54 #define IMP_KERNEL_LARGE_UNORDERED_SET boost::unordered_set
55 #define IMP_KERNEL_LARGE_UNORDERED_MAP boost::unordered_map
60 template<
class Archive,
class Key,
class T>
61 struct specialize<Archive, boost::unordered_map<Key, T>,
62 cereal::specialization::non_member_load_save> {};
65 #if defined(_MSC_VER) && _MSC_VER <= 1500
68 #include <boost/unordered_set.hpp>
69 #include <boost/unordered_map.hpp>
71 #define IMP_KERNEL_SMALL_ORDERED_SET std::set
72 #define IMP_KERNEL_SMALL_ORDERED_MAP std::map
73 #define IMP_KERNEL_SMALL_UNORDERED_SET boost::unordered_set
74 #define IMP_KERNEL_SMALL_UNORDERED_MAP boost::unordered_map
76 #include <boost/container/flat_set.hpp>
77 #include <boost/container/flat_map.hpp>
78 #include <cereal/access.hpp>
79 #define IMP_KERNEL_SMALL_ORDERED_SET boost::container::flat_set
80 #define IMP_KERNEL_SMALL_ORDERED_MAP boost::container::flat_map
81 #define IMP_KERNEL_SMALL_UNORDERED_SET boost::container::flat_set
82 #define IMP_KERNEL_SMALL_UNORDERED_MAP boost::container::flat_map
86 template<
class Archive,
typename Key,
typename Compare,
typename Allocator>
87 inline void save(Archive &ar,
88 boost::container::flat_set<Key, Compare, Allocator>
const &t) {
89 auto count = t.size();
91 typename boost::container::flat_set<
92 Key, Compare, Allocator>::const_iterator it = t.begin();
98 template<
class Archive,
typename Key,
typename Compare,
typename Allocator>
99 inline void load(Archive &ar,
100 boost::container::flat_set<Key, Compare, Allocator> &t) {
101 typedef typename boost::container::flat_set<Key, Compare, Allocator>::iterator iterator;
102 typedef typename boost::container::flat_set<Key, Compare, Allocator>::value_type value_type;
104 typename boost::container::flat_set<Key, Compare, Allocator>::size_type count;
106 iterator hint = t.begin();
110 hint = t.insert(hint, key);