mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Move internal::swap to numext to fix ambiguous call with std::swap
This commit is contained in:
@@ -89,9 +89,9 @@ template<typename T> struct enable_if<true,T>
|
||||
{ typedef T type; };
|
||||
|
||||
#if defined(__CUDA_ARCH__)
|
||||
template<typename T> EIGEN_DEVICE_FUNC void swap(T &a, T &b) { T tmp = b; b = a; a = tmp; }
|
||||
|
||||
namespace device {
|
||||
|
||||
template<typename T> struct numeric_limits
|
||||
{
|
||||
EIGEN_DEVICE_FUNC
|
||||
@@ -110,8 +110,6 @@ template<> struct numeric_limits<double>
|
||||
|
||||
}
|
||||
|
||||
#else
|
||||
template<typename T> EIGEN_STRONG_INLINE void swap(T &a, T &b) { std::swap(a,b); }
|
||||
#endif
|
||||
|
||||
/** \internal
|
||||
@@ -262,6 +260,16 @@ template<typename T, int S> struct is_diagonal<DiagonalMatrix<T,S> >
|
||||
|
||||
} // end namespace internal
|
||||
|
||||
namespace numext {
|
||||
|
||||
#if defined(__CUDA_ARCH__)
|
||||
template<typename T> EIGEN_DEVICE_FUNC void swap(T &a, T &b) { T tmp = b; b = a; a = tmp; }
|
||||
#else
|
||||
template<typename T> EIGEN_STRONG_INLINE void swap(T &a, T &b) { std::swap(a,b); }
|
||||
#endif
|
||||
|
||||
} // end namespace numext
|
||||
|
||||
} // end namespace Eigen
|
||||
|
||||
#endif // EIGEN_META_H
|
||||
|
||||
Reference in New Issue
Block a user