summaryrefslogtreecommitdiff
path: root/graphics/openmvs/files/patch-libs_MVS_Mesh.cpp
blob: fd6e20e61e5faab09b2b130783a73a626ab394bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--- libs/MVS/Mesh.cpp.orig	2024-05-27 00:00:00 UTC
+++ libs/MVS/Mesh.cpp
@@ -35,6 +35,22 @@
 #include <boost/graph/adjacency_list.hpp>
 #include <boost/graph/filtered_graph.hpp>
 #include <boost/graph/connected_components.hpp>
+// Fix for vcglib compatibility with modern C++ standard library
+#include <algorithm>
+#include <random>
+namespace std {
+// Provide random_shuffle for C++14/17 when it's been removed
+template<class RandomIt, class RandomFunc>
+void random_shuffle(RandomIt first, RandomIt last, RandomFunc& r) {
+    std::shuffle(first, last, std::default_random_engine());
+}
+// Provide unary_function for vcglib
+template <typename ArgumentType, typename ResultType>
+struct unary_function {
+    typedef ArgumentType argument_type;
+    typedef ResultType result_type;
+};
+}
 #ifdef _MSC_VER
 #pragma warning(push)
 #pragma warning(disable: 4244 4267 4305)