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
57 #if defined(_MSC_VER) && _MSC_VER <= 1500
60 #include <boost/unordered_set.hpp>
61 #include <boost/unordered_map.hpp>
63 #define IMP_KERNEL_SMALL_ORDERED_SET std::set
64 #define IMP_KERNEL_SMALL_ORDERED_MAP std::map
65 #define IMP_KERNEL_SMALL_UNORDERED_SET boost::unordered_set
66 #define IMP_KERNEL_SMALL_UNORDERED_MAP boost::unordered_map
68 #include <boost/container/flat_set.hpp>
69 #include <boost/container/flat_map.hpp>
70 #include <cereal/access.hpp>
71 #define IMP_KERNEL_SMALL_ORDERED_SET boost::container::flat_set
72 #define IMP_KERNEL_SMALL_ORDERED_MAP boost::container::flat_map
73 #define IMP_KERNEL_SMALL_UNORDERED_SET boost::container::flat_set
74 #define IMP_KERNEL_SMALL_UNORDERED_MAP boost::container::flat_map
78 template<
class Archive,
typename Key,
typename Compare,
typename Allocator>
79 inline void save(Archive &ar,
80 boost::container::flat_set<Key, Compare, Allocator>
const &t) {
81 auto count = t.size();
83 typename boost::container::flat_set<
84 Key, Compare, Allocator>::const_iterator it = t.begin();
90 template<
class Archive,
typename Key,
typename Compare,
typename Allocator>
91 inline void load(Archive &ar,
92 boost::container::flat_set<Key, Compare, Allocator> &t) {
93 typedef typename boost::container::flat_set<Key, Compare, Allocator>::iterator iterator;
94 typedef typename boost::container::flat_set<Key, Compare, Allocator>::value_type value_type;
96 typename boost::container::flat_set<Key, Compare, Allocator>::size_type count;
98 iterator hint = t.begin();
102 hint = t.insert(hint, key);