mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-27 07:29:52 +08:00
Fix clang tidy warnings in AnnoyingScalar.
Clang-tidy complains that full specializations in headers can cause ODR violations. Marked these as `inline` to fix. It also complains about renaming arguments in specializations. Set the argument names to match.
This commit is contained in:
parent
90187a33e1
commit
ace7f132ed
@ -145,12 +145,12 @@ bool (isfinite)(const AnnoyingScalar& x) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
template<> AnnoyingScalar pcmp_eq(const AnnoyingScalar& x, const AnnoyingScalar& y)
|
template<> EIGEN_STRONG_INLINE AnnoyingScalar pcmp_eq(const AnnoyingScalar& a, const AnnoyingScalar& b)
|
||||||
{ return AnnoyingScalar(pcmp_eq(*x.v, *y.v)); }
|
{ return AnnoyingScalar(pcmp_eq(*a.v, *b.v)); }
|
||||||
template<> AnnoyingScalar pselect(const AnnoyingScalar& cond, const AnnoyingScalar& x, const AnnoyingScalar& y)
|
template<> EIGEN_STRONG_INLINE AnnoyingScalar pselect(const AnnoyingScalar& mask, const AnnoyingScalar& a, const AnnoyingScalar& b)
|
||||||
{ return numext::equal_strict(*cond.v, 0.f) ? y : x; }
|
{ return numext::equal_strict(*mask.v, 0.f) ? b : a; }
|
||||||
template<> double cast(const AnnoyingScalar& x) { return double(*x.v); }
|
template<> EIGEN_STRONG_INLINE double cast(const AnnoyingScalar& x) { return double(*x.v); }
|
||||||
template<> float cast(const AnnoyingScalar& x) { return *x.v; }
|
template<> EIGEN_STRONG_INLINE float cast(const AnnoyingScalar& x) { return *x.v; }
|
||||||
}
|
}
|
||||||
} // namespace Eigen
|
} // namespace Eigen
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user