From c486af5ad38a8cd2d12b790123b55456e902341c Mon Sep 17 00:00:00 2001 From: Markus Vieth Date: Mon, 20 Jan 2025 16:04:43 +0000 Subject: [PATCH] Change Eigen::aligned_allocator to not inherit from std::allocator --- Eigen/src/Core/util/Memory.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h index a278c9129..2c0f9d705 100644 --- a/Eigen/src/Core/util/Memory.h +++ b/Eigen/src/Core/util/Memory.h @@ -913,7 +913,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void* eigen_aligned_alloca_helper(void* pt * \sa \blank \ref TopicStlContainers. */ template -class aligned_allocator : public std::allocator { +class aligned_allocator { public: typedef std::size_t size_type; typedef std::ptrdiff_t difference_type; @@ -928,14 +928,21 @@ class aligned_allocator : public std::allocator { typedef aligned_allocator other; }; - aligned_allocator() : std::allocator() {} + aligned_allocator() = default; - aligned_allocator(const aligned_allocator& other) : std::allocator(other) {} + aligned_allocator(const aligned_allocator&) = default; template - aligned_allocator(const aligned_allocator& other) : std::allocator(other) {} + aligned_allocator(const aligned_allocator&) {} - ~aligned_allocator() {} + template + constexpr bool operator==(const aligned_allocator&) const noexcept { + return true; + } + template + constexpr bool operator!=(const aligned_allocator&) const noexcept { + return false; + } #if EIGEN_COMP_GNUC_STRICT && EIGEN_GNUC_STRICT_AT_LEAST(7, 0, 0) // In gcc std::allocator::max_size() is bugged making gcc triggers a warning: