diff options
author | Antonio Sanchez <cantonios@google.com> | 2021-04-05 12:19:27 -0700 |
---|---|---|
committer | Antonio Sanchez <cantonios@google.com> | 2021-04-05 12:49:38 -0700 |
commit | ace7f132edcec0abffd9842d531c28a2455d789c (patch) | |
tree | a523b7c65e8d986dd55e5eaec4157276d492df39 /test | |
parent | 90187a33e141cb8a93953815e8948357350881df (diff) |
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.
Diffstat (limited to 'test')
-rw-r--r-- | test/AnnoyingScalar.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/AnnoyingScalar.h b/test/AnnoyingScalar.h index 9f8d52796..0f8e70d36 100644 --- a/test/AnnoyingScalar.h +++ b/test/AnnoyingScalar.h @@ -145,12 +145,12 @@ bool (isfinite)(const AnnoyingScalar& x) { } namespace internal { - template<> AnnoyingScalar pcmp_eq(const AnnoyingScalar& x, const AnnoyingScalar& y) - { return AnnoyingScalar(pcmp_eq(*x.v, *y.v)); } - template<> AnnoyingScalar pselect(const AnnoyingScalar& cond, const AnnoyingScalar& x, const AnnoyingScalar& y) - { return numext::equal_strict(*cond.v, 0.f) ? y : x; } - template<> double cast(const AnnoyingScalar& x) { return double(*x.v); } - template<> float cast(const AnnoyingScalar& x) { return *x.v; } + template<> EIGEN_STRONG_INLINE AnnoyingScalar pcmp_eq(const AnnoyingScalar& a, const AnnoyingScalar& b) + { return AnnoyingScalar(pcmp_eq(*a.v, *b.v)); } + template<> EIGEN_STRONG_INLINE AnnoyingScalar pselect(const AnnoyingScalar& mask, const AnnoyingScalar& a, const AnnoyingScalar& b) + { return numext::equal_strict(*mask.v, 0.f) ? b : a; } + template<> EIGEN_STRONG_INLINE double cast(const AnnoyingScalar& x) { return double(*x.v); } + template<> EIGEN_STRONG_INLINE float cast(const AnnoyingScalar& x) { return *x.v; } } } // namespace Eigen |