OSSIA
Open Scenario System for Interactive Application
hash_map.hpp
1 #pragma once
2 #include <ossia/detail/hash.hpp>
3 
4 #include <cstdint>
5 
6 #if defined(_GLIBCXX_DEBUG)
7 #define OSSIA_NO_FAST_CONTAINERS
8 #elif defined(_LIBCPP_DEBUG_LEVEL) && _LIBCPP_DEBUG_LEVEL > 0
9 #define OSSIA_NO_FAST_CONTAINERS
10 #elif defined(_LIBCPP_ENABLE_ASSERTIONS) && _LIBCPP_ENABLE_ASSERTIONS > 0
11 #define OSSIA_NO_FAST_CONTAINERS
12 #elif defined(_LIBCPP_ENABLE_DEBUG_MODE)
13 #define OSSIA_NO_FAST_CONTAINERS
14 #elif defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL > 0
15 #define OSSIA_NO_FAST_CONTAINERS
16 
17 #endif
18 
19 #if !defined(OSSIA_NO_FAST_CONTAINERS)
20 #include <ankerl/unordered_dense.h>
21 #include <unordered_map>
22 namespace ossia
23 {
24 template <
25  typename K, typename H = ossia::hash<K>, typename E = ossia::equal_to<K>,
26  typename A = std::allocator<K>>
27 using hash_set = ankerl::unordered_dense::set<K, H, E, A>;
28 
29 template <
30  typename K, typename V, typename H = ossia::hash<K>, typename E = ossia::equal_to<K>,
31  typename A = std::allocator<std::pair<K, V>>>
32 using hash_map = ankerl::unordered_dense::map<K, V, H, E, A>;
33 
34 template <
35  typename K, typename V, typename H = ossia::hash<K>, typename E = ossia::equal_to<K>,
36  typename A = void>
37 using hash_multimap = std::unordered_multimap<K, V, H, E>;
38 }
39 #else
40 #include <unordered_map>
41 #include <unordered_set>
42 namespace ossia
43 {
44 template <
45  typename K, typename H = ossia::hash<K>, typename E = ossia::equal_to<K>,
46  typename A = void>
47 using hash_set = std::unordered_set<K, H, E>;
48 
49 template <
50  typename K, typename V, typename H = ossia::hash<K>, typename E = ossia::equal_to<K>,
51  typename A = void>
52 using hash_map = std::unordered_map<K, V, H, E>;
53 
54 template <
55  typename K, typename V, typename H = ossia::hash<K>, typename E = ossia::equal_to<K>,
56  typename A = void>
57 using hash_multimap = std::unordered_multimap<K, V, H, E>;
58 }
59 #endif
Definition: git_info.h:7