OSSIA
Open Scenario System for Interactive Application
flat_map.hpp
1 #pragma once
2 #include <boost/container/flat_map.hpp>
3 namespace ossia
4 {
5 /* Too hard to make work
6 template <typename T, typename U>
7 struct pod_pair {
8  using first_type = T;
9  using second_type = U;
10  T first;
11  U second;
12 };
13 
14 template<typename K, typename V>
15 using pod_pair_type = std::conditional_t<
16  std::is_trivial_v<pod_pair<K,V>> && std::is_aggregate_v<pod_pair<K,V>>,
17  pod_pair<K,V>,
18  std::pair<K,V>>;
19 
20 template<typename K, typename V>
21 using pod_pair_allocator = std::conditional_t<
22  std::is_trivial_v<pod_pair<K,V>> && std::is_aggregate_v<pod_pair<K,V>>,
23  pod_allocator<pod_pair<K,V>>,
24  std::allocator<std::pair<K,V>>
25 >;
26 
27 template <typename K, typename V, typename Compare = std::less<void>, typename
28 Alloc = pod_pair_allocator<K, V>> using flat_map =
29 fc::flat_map<std::vector<pod_pair_type<K,V>, Alloc>, Compare>;
30 */
31 template <
32  typename K, typename V, typename Compare = std::less<void>,
33  typename Alloc = std::allocator<std::pair<K, V>>>
34 using flat_map = boost::container::flat_map<K, V, Compare, Alloc>;
35 }
Definition: git_info.h:7