mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Get rid of custom implementation of equal_to and not_equal_no. No longer needed with c+14.
This commit is contained in:
@@ -13,29 +13,6 @@
|
||||
#include "../InternalHeaderCheck.h"
|
||||
|
||||
namespace Eigen {
|
||||
|
||||
// Portable replacements for certain functors.
|
||||
namespace numext {
|
||||
|
||||
template<typename T = void>
|
||||
struct equal_to {
|
||||
typedef bool result_type;
|
||||
EIGEN_DEVICE_FUNC bool operator()(const T& lhs, const T& rhs) const {
|
||||
return lhs == rhs;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T = void>
|
||||
struct not_equal_to {
|
||||
typedef bool result_type;
|
||||
EIGEN_DEVICE_FUNC bool operator()(const T& lhs, const T& rhs) const {
|
||||
return lhs != rhs;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
namespace internal {
|
||||
|
||||
// default functor traits for STL functors:
|
||||
@@ -92,18 +69,10 @@ template<typename T>
|
||||
struct functor_traits<std::equal_to<T> >
|
||||
{ enum { Cost = 1, PacketAccess = false }; };
|
||||
|
||||
template<typename T>
|
||||
struct functor_traits<numext::equal_to<T> >
|
||||
: functor_traits<std::equal_to<T> > {};
|
||||
|
||||
template<typename T>
|
||||
struct functor_traits<std::not_equal_to<T> >
|
||||
{ enum { Cost = 1, PacketAccess = false }; };
|
||||
|
||||
template<typename T>
|
||||
struct functor_traits<numext::not_equal_to<T> >
|
||||
: functor_traits<std::not_equal_to<T> > {};
|
||||
|
||||
#if (EIGEN_COMP_CXXVER < 17)
|
||||
// std::unary_negate is deprecated since c++17 and will be removed in c++20
|
||||
template<typename T>
|
||||
|
||||
Reference in New Issue
Block a user