2023-05-29 12:01:36 +02:00
|
|
|
diff --git base/ranges/ranges.h base/ranges/ranges.h
|
2024-01-26 03:12:43 +01:00
|
|
|
index 27eac4f3a4c39..2cb63bec79e63 100644
|
2023-05-29 12:01:36 +02:00
|
|
|
--- base/ranges/ranges.h
|
|
|
|
+++ base/ranges/ranges.h
|
|
|
|
@@ -30,12 +30,14 @@ constexpr T* begin(std::array<T, N>& array, priority_tag<2> tag) {
|
|
|
|
return const_cast<T*>(begin(const_cast<const std::array<T, N>&>(array), tag));
|
|
|
|
}
|
|
|
|
|
|
|
|
+#if !defined(CEF_EXCLUDE_PROBLEMATIC_CONST_ARRAY_OVERLOADS)
|
|
|
|
// Overload for const std::array. Required since std::array::begin is not
|
|
|
|
// constexpr prior to C++17.
|
|
|
|
template <typename T, size_t N>
|
|
|
|
constexpr const T* begin(const std::array<T, N>& array, priority_tag<2>) {
|
|
|
|
return N != 0 ? &array[0] : nullptr;
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
// Generic container overload.
|
|
|
|
template <typename Range>
|
|
|
|
@@ -65,12 +67,14 @@ constexpr T* end(std::array<T, N>& array, priority_tag<2> tag) {
|
|
|
|
return const_cast<T*>(end(const_cast<const std::array<T, N>&>(array), tag));
|
|
|
|
}
|
|
|
|
|
|
|
|
+#if !defined(CEF_EXCLUDE_PROBLEMATIC_CONST_ARRAY_OVERLOADS)
|
|
|
|
// Overload for const std::array. Required since std::array::end is not
|
|
|
|
// constexpr prior to C++17.
|
|
|
|
template <typename T, size_t N>
|
|
|
|
constexpr const T* end(const std::array<T, N>& array, priority_tag<2>) {
|
|
|
|
return N != 0 ? (&array[0]) + N : nullptr;
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
// Generic container overload.
|
|
|
|
template <typename Range>
|
|
|
|
diff --git base/win/registry.cc base/win/registry.cc
|
2023-10-19 20:08:48 +02:00
|
|
|
index 7b9dcb90e627e..275b60e6c2a28 100644
|
2023-05-29 12:01:36 +02:00
|
|
|
--- base/win/registry.cc
|
|
|
|
+++ base/win/registry.cc
|
2023-09-15 21:51:43 +02:00
|
|
|
@@ -14,6 +14,14 @@
|
2023-05-29 12:01:36 +02:00
|
|
|
#include <utility>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
+#include "cef/libcef/features/features.h"
|
|
|
|
+
|
|
|
|
+#if BUILDFLAG(IS_CEF_SANDBOX_BUILD)
|
|
|
|
+// Avoid overloads for const std::array in base/ranges/ranges.h that don't
|
|
|
|
+// compile with MSVC. See issue #3519.
|
|
|
|
+#define CEF_EXCLUDE_PROBLEMATIC_CONST_ARRAY_OVERLOADS 1
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
#include "base/check_op.h"
|
|
|
|
#include "base/functional/callback.h"
|
2023-08-09 23:17:17 +02:00
|
|
|
#include "base/notreached.h"
|