Skip to content

Commit 407e3e2

Browse files
committed
bug #1532: disable stl::*_negate in C++17 (they are deprecated)
1 parent 40b4bf3 commit 407e3e2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Eigen/src/Core/functors/StlFunctors.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,17 @@ struct functor_traits<std::binder1st<T> >
8383
{ enum { Cost = functor_traits<T>::Cost, PacketAccess = false }; };
8484
#endif
8585

86+
#if (__cplusplus < 201703L) && (EIGEN_COMP_MSVC < 1910)
87+
// std::unary_negate is deprecated since c++17 and will be removed in c++20
8688
template<typename T>
8789
struct functor_traits<std::unary_negate<T> >
8890
{ enum { Cost = 1 + functor_traits<T>::Cost, PacketAccess = false }; };
8991

92+
// std::binary_negate is deprecated since c++17 and will be removed in c++20
9093
template<typename T>
9194
struct functor_traits<std::binary_negate<T> >
9295
{ enum { Cost = 1 + functor_traits<T>::Cost, PacketAccess = false }; };
96+
#endif
9397

9498
#ifdef EIGEN_STDEXT_SUPPORT
9599

0 commit comments

Comments
 (0)