|
| 1 | +diff --git a/lemon/bits/array_map.h b/lemon/bits/array_map.h |
| 2 | +index 355ee00..c3992cf 100644 |
| 3 | +--- a/lemon/bits/array_map.h |
| 4 | ++++ b/lemon/bits/array_map.h |
| 5 | +@@ -88,7 +88,7 @@ namespace lemon { |
| 6 | + Item it; |
| 7 | + for (nf->first(it); it != INVALID; nf->next(it)) { |
| 8 | + int id = nf->id(it);; |
| 9 | +- allocator.construct(&(values[id]), Value()); |
| 10 | ++ std::allocator_traits<Allocator>::construct(allocator, &(values[id]), Value()); |
| 11 | + } |
| 12 | + } |
| 13 | + |
| 14 | +@@ -102,7 +102,7 @@ namespace lemon { |
| 15 | + Item it; |
| 16 | + for (nf->first(it); it != INVALID; nf->next(it)) { |
| 17 | + int id = nf->id(it);; |
| 18 | +- allocator.construct(&(values[id]), value); |
| 19 | ++ std::allocator_traits<Allocator>::construct(allocator, &(values[id]), value); |
| 20 | + } |
| 21 | + } |
| 22 | + |
| 23 | +@@ -121,7 +121,7 @@ namespace lemon { |
| 24 | + Item it; |
| 25 | + for (nf->first(it); it != INVALID; nf->next(it)) { |
| 26 | + int id = nf->id(it);; |
| 27 | +- allocator.construct(&(values[id]), copy.values[id]); |
| 28 | ++ std::allocator_traits<Allocator>::construct(allocator, &(values[id]), copy.values[id]); |
| 29 | + } |
| 30 | + } |
| 31 | + |
| 32 | +@@ -218,15 +218,15 @@ namespace lemon { |
| 33 | + for (nf->first(it); it != INVALID; nf->next(it)) { |
| 34 | + int jd = nf->id(it);; |
| 35 | + if (id != jd) { |
| 36 | +- allocator.construct(&(new_values[jd]), values[jd]); |
| 37 | +- allocator.destroy(&(values[jd])); |
| 38 | ++ std::allocator_traits<Allocator>::construct(allocator, &(new_values[jd]), values[jd]); |
| 39 | ++ std::allocator_traits<Allocator>::destroy(allocator, &(values[jd])); |
| 40 | + } |
| 41 | + } |
| 42 | + if (capacity != 0) allocator.deallocate(values, capacity); |
| 43 | + values = new_values; |
| 44 | + capacity = new_capacity; |
| 45 | + } |
| 46 | +- allocator.construct(&(values[id]), Value()); |
| 47 | ++ std::allocator_traits<Allocator>::construct(allocator, &(values[id]), Value()); |
| 48 | + } |
| 49 | + |
| 50 | + // \brief Adds more new keys to the map. |
| 51 | +@@ -260,8 +260,8 @@ namespace lemon { |
| 52 | + } |
| 53 | + } |
| 54 | + if (found) continue; |
| 55 | +- allocator.construct(&(new_values[id]), values[id]); |
| 56 | +- allocator.destroy(&(values[id])); |
| 57 | ++ std::allocator_traits<Allocator>::construct(allocator, &(new_values[id]), values[id]); |
| 58 | ++ std::allocator_traits<Allocator>::destroy(allocator, &(values[id])); |
| 59 | + } |
| 60 | + if (capacity != 0) allocator.deallocate(values, capacity); |
| 61 | + values = new_values; |
| 62 | +@@ -269,7 +269,7 @@ namespace lemon { |
| 63 | + } |
| 64 | + for (int i = 0; i < int(keys.size()); ++i) { |
| 65 | + int id = nf->id(keys[i]); |
| 66 | +- allocator.construct(&(values[id]), Value()); |
| 67 | ++ std::allocator_traits<Allocator>::construct(allocator, &(values[id]), Value()); |
| 68 | + } |
| 69 | + } |
| 70 | + |
| 71 | +@@ -279,7 +279,7 @@ namespace lemon { |
| 72 | + // and it overrides the erase() member function of the observer base. |
| 73 | + virtual void erase(const Key& key) { |
| 74 | + int id = Parent::notifier()->id(key); |
| 75 | +- allocator.destroy(&(values[id])); |
| 76 | ++ std::allocator_traits<Allocator>::destroy(allocator, &(values[id])); |
| 77 | + } |
| 78 | + |
| 79 | + // \brief Erase more keys from the map. |
| 80 | +@@ -289,7 +289,7 @@ namespace lemon { |
| 81 | + virtual void erase(const std::vector<Key>& keys) { |
| 82 | + for (int i = 0; i < int(keys.size()); ++i) { |
| 83 | + int id = Parent::notifier()->id(keys[i]); |
| 84 | +- allocator.destroy(&(values[id])); |
| 85 | ++ std::allocator_traits<Allocator>::destroy(allocator, &(values[id])); |
| 86 | + } |
| 87 | + } |
| 88 | + |
| 89 | +@@ -303,7 +303,7 @@ namespace lemon { |
| 90 | + Item it; |
| 91 | + for (nf->first(it); it != INVALID; nf->next(it)) { |
| 92 | + int id = nf->id(it);; |
| 93 | +- allocator.construct(&(values[id]), Value()); |
| 94 | ++ std::allocator_traits<Allocator>::construct(allocator, &(values[id]), Value()); |
| 95 | + } |
| 96 | + } |
| 97 | + |
| 98 | +@@ -317,7 +317,7 @@ namespace lemon { |
| 99 | + Item it; |
| 100 | + for (nf->first(it); it != INVALID; nf->next(it)) { |
| 101 | + int id = nf->id(it); |
| 102 | +- allocator.destroy(&(values[id])); |
| 103 | ++ std::allocator_traits<Allocator>::destroy(allocator, &(values[id])); |
| 104 | + } |
| 105 | + allocator.deallocate(values, capacity); |
| 106 | + capacity = 0; |
0 commit comments