[Bf-blender-cvs] [176324aa5cf] master: QuadriFlow: Fix std::allocator deprecation warnings

Ankit Meel noreply at git.blender.org
Sun Nov 29 20:16:31 CET 2020


Commit: 176324aa5cfcf0703dfae296028bc3aef1ff5f14
Author: Ankit Meel
Date:   Sun Nov 29 16:12:34 2020 +0530
Branches: master
https://developer.blender.org/rB176324aa5cfcf0703dfae296028bc3aef1ff5f14

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

===================================================================

M	extern/quadriflow/3rd/lemon-1.3.1/lemon/bits/array_map.h
M	extern/quadriflow/patches/blender.patch

===================================================================

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;
diff --git a/extern/quadriflow/patches/blender.patch b/extern/quadriflow/patches/blender.patch
index 6405a47e262..9e694a2d616 100644
--- a/extern/quadriflow/patches/blender.patch
+++ b/extern/quadriflow/patches/blender.patch
@@ -143,3 +143,91 @@ index 8de74ede8a9..f9861f39169 100644
  
          num = length - shift;
          while (num--) {
+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;



More information about the Bf-blender-cvs mailing list