diff options
author | Ankit Meel <ankitjmeel@gmail.com> | 2020-11-29 13:42:34 +0300 |
---|---|---|
committer | Ankit Meel <ankitjmeel@gmail.com> | 2020-11-29 22:16:27 +0300 |
commit | 176324aa5cfcf0703dfae296028bc3aef1ff5f14 (patch) | |
tree | 74fe0982f91df5f6831e23237172b01359fcec02 /extern/quadriflow/3rd/lemon-1.3.1/lemon/bits/array_map.h | |
parent | 11f0169e887e241b4f638cfbea18e2ddb1bfad9b (diff) |
QuadriFlow: Fix std::allocator deprecation warnings
https://en.cppreference.com/w/cpp/memory/allocator/construct
"(deprecated in C++17) (removed in C++20)"
Same for `destroy`.
Reviewed By: zeddb
Differential Revision: https://developer.blender.org/D9657
Diffstat (limited to 'extern/quadriflow/3rd/lemon-1.3.1/lemon/bits/array_map.h')
-rw-r--r-- | extern/quadriflow/3rd/lemon-1.3.1/lemon/bits/array_map.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/extern/quadriflow/3rd/lemon-1.3.1/lemon/bits/array_map.h b/extern/quadriflow/3rd/lemon-1.3.1/lemon/bits/array_map.h index 355ee008246..a770bbee60c 100644 --- a/extern/quadriflow/3rd/lemon-1.3.1/lemon/bits/array_map.h +++ b/extern/quadriflow/3rd/lemon-1.3.1/lemon/bits/array_map.h @@ -88,7 +88,7 @@ namespace lemon { Item it; for (nf->first(it); it != INVALID; nf->next(it)) { int id = nf->id(it);; - allocator.construct(&(values[id]), Value()); + std::allocator_traits<Allocator>::construct(allocator, &(values[id]), Value()); } } @@ -218,15 +218,15 @@ namespace lemon { for (nf->first(it); it != INVALID; nf->next(it)) { int jd = nf->id(it);; if (id != jd) { - allocator.construct(&(new_values[jd]), values[jd]); - allocator.destroy(&(values[jd])); + std::allocator_traits<Allocator>::construct(allocator, &(new_values[jd]), values[jd]); + std::allocator_traits<Allocator>::destroy(allocator, &(values[jd])); } } if (capacity != 0) allocator.deallocate(values, capacity); values = new_values; capacity = new_capacity; } - allocator.construct(&(values[id]), Value()); + std::allocator_traits<Allocator>::construct(allocator, &(values[id]), Value()); } // \brief Adds more new keys to the map. @@ -260,8 +260,8 @@ namespace lemon { } } if (found) continue; - allocator.construct(&(new_values[id]), values[id]); - allocator.destroy(&(values[id])); + std::allocator_traits<Allocator>::construct(allocator, &(new_values[id]), values[id]); + std::allocator_traits<Allocator>::destroy(allocator, &(values[id])); } if (capacity != 0) allocator.deallocate(values, capacity); values = new_values; @@ -269,7 +269,7 @@ namespace lemon { } for (int i = 0; i < int(keys.size()); ++i) { int id = nf->id(keys[i]); - allocator.construct(&(values[id]), Value()); + std::allocator_traits<Allocator>::construct(allocator, &(values[id]), Value()); } } @@ -279,7 +279,7 @@ namespace lemon { // and it overrides the erase() member function of the observer base. virtual void erase(const Key& key) { int id = Parent::notifier()->id(key); - allocator.destroy(&(values[id])); + std::allocator_traits<Allocator>::destroy(allocator, &(values[id])); } // \brief Erase more keys from the map. @@ -289,7 +289,7 @@ namespace lemon { virtual void erase(const std::vector<Key>& keys) { for (int i = 0; i < int(keys.size()); ++i) { int id = Parent::notifier()->id(keys[i]); - allocator.destroy(&(values[id])); + std::allocator_traits<Allocator>::destroy(allocator, &(values[id])); } } @@ -303,7 +303,7 @@ namespace lemon { Item it; for (nf->first(it); it != INVALID; nf->next(it)) { int id = nf->id(it);; - allocator.construct(&(values[id]), Value()); + std::allocator_traits<Allocator>::construct(allocator, &(values[id]), Value()); } } @@ -317,7 +317,7 @@ namespace lemon { Item it; for (nf->first(it); it != INVALID; nf->next(it)) { int id = nf->id(it); - allocator.destroy(&(values[id])); + std::allocator_traits<Allocator>::destroy(allocator, &(values[id])); } allocator.deallocate(values, capacity); capacity = 0; |