From 3fb42ff7b27822e7f2a948528a5a5a77e3ae7f84 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 3 Apr 2018 15:59:30 +0200 Subject: [PATCH] bug #1532: disable stl::*_negate in C++17 (they are deprecated) (grafted from 407e3e2621077a6cd768042c88c652ad75a085ae ) --- Eigen/src/Core/functors/StlFunctors.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Eigen/src/Core/functors/StlFunctors.h b/Eigen/src/Core/functors/StlFunctors.h index 6df3fa501..9c1d75850 100644 --- a/Eigen/src/Core/functors/StlFunctors.h +++ b/Eigen/src/Core/functors/StlFunctors.h @@ -83,13 +83,17 @@ struct functor_traits > { enum { Cost = functor_traits::Cost, PacketAccess = false }; }; #endif +#if (__cplusplus < 201703L) && (EIGEN_COMP_MSVC < 1910) +// std::unary_negate is deprecated since c++17 and will be removed in c++20 template struct functor_traits > { enum { Cost = 1 + functor_traits::Cost, PacketAccess = false }; }; +// std::binary_negate is deprecated since c++17 and will be removed in c++20 template struct functor_traits > { enum { Cost = 1 + functor_traits::Cost, PacketAccess = false }; }; +#endif #ifdef EIGEN_STDEXT_SUPPORT