mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
bug #872: Avoid deprecated binder1st/binder2nd usage by providing custom functors for comparison operators
This commit is contained in:
@@ -246,24 +246,5 @@ cube() const
|
||||
return CubeReturnType(derived());
|
||||
}
|
||||
|
||||
#define EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(METHOD_NAME,FUNCTOR) \
|
||||
EIGEN_DEVICE_FUNC \
|
||||
inline const CwiseUnaryOp<std::binder2nd<FUNCTOR<Scalar> >, const Derived> \
|
||||
METHOD_NAME(const Scalar& s) const { \
|
||||
return CwiseUnaryOp<std::binder2nd<FUNCTOR<Scalar> >, const Derived> \
|
||||
(derived(), std::bind2nd(FUNCTOR<Scalar>(), s)); \
|
||||
} \
|
||||
friend inline const CwiseUnaryOp<std::binder1st<FUNCTOR<Scalar> >, const Derived> \
|
||||
METHOD_NAME(const Scalar& s, const Derived& d) { \
|
||||
return CwiseUnaryOp<std::binder1st<FUNCTOR<Scalar> >, const Derived> \
|
||||
(d, std::bind1st(FUNCTOR<Scalar>(), s)); \
|
||||
}
|
||||
|
||||
EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(operator==, std::equal_to)
|
||||
EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(operator!=, std::not_equal_to)
|
||||
EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(operator<, std::less)
|
||||
EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(operator<=, std::less_equal)
|
||||
EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(operator>, std::greater)
|
||||
EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(operator>=, std::greater_equal)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user