@@ -146,28 +146,30 @@ MAKE_UNARY_FUN(sign, sign_, sign_impl)
146146
147147/* --- Macro to create expressions and overloads for binary functions. ---*/
148148
149- #define MAKE_BINARY_FUN (FUN, EXPR, IMPL ) \
150- /* !--- Expression class. ---*/ \
151- template <class U , class V , class Scalar > \
152- class EXPR : public CVecExpr <EXPR<U, V, Scalar>, Scalar> { \
153- store_t <const U> u; \
154- store_t <const V> v; \
155- \
156- public: \
157- static constexpr bool StoreAsRef = false ; \
158- FORCEINLINE EXPR (const U& u_, const V& v_) : u(u_), v(v_) {} \
159- FORCEINLINE auto operator [](size_t i) const RETURNS (IMPL(u[i], v[i])) \
160- }; \
161- /* !--- Vector with vector function overload. ---*/ \
162- template <class U , class V , class S > \
163- FORCEINLINE auto FUN (const CVecExpr<U, S>& u, const CVecExpr<V, S>& v) \
164- RETURNS(EXPR<U, V, S>(u.derived(), v.derived())) /* !--- Vector with scalar function overload. ---*/ \
165- template <class U, class S> \
166- FORCEINLINE auto FUN(const CVecExpr<U, S>& u, decay_t <S> v) \
167- RETURNS(EXPR<U, Bcast<S>, S>(u.derived(), Bcast<S>(v))) /* !--- Scalar with vector function overload. ---*/ \
168- template <class S, class V> \
169- FORCEINLINE auto FUN(decay_t <S> u, const CVecExpr<V, S>& v) \
170- RETURNS(EXPR<Bcast<S>, V, S>(Bcast<S>(u), v.derived()))
149+ // clang-format off
150+ #define MAKE_BINARY_FUN (FUN, EXPR, IMPL ) \
151+ /* !--- Expression class. ---*/ \
152+ template <class U , class V , class Scalar > \
153+ class EXPR : public CVecExpr <EXPR<U, V, Scalar>, Scalar> { \
154+ store_t <const U> u; \
155+ store_t <const V> v; \
156+ \
157+ public: \
158+ static constexpr bool StoreAsRef = false ; \
159+ FORCEINLINE EXPR (const U& u_, const V& v_) : u(u_), v(v_) {} \
160+ FORCEINLINE auto operator [](size_t i) const RETURNS (IMPL(u[i], v[i])) \
161+ }; \
162+ /* !--- Vector with vector function overload. ---*/ \
163+ template <class U , class V , class S > \
164+ FORCEINLINE auto FUN (const CVecExpr<U, S>& u, const CVecExpr<V, S>& v) \
165+ RETURNS(EXPR<U, V, S>(u.derived(), v.derived())) \
166+ /* !--- Vector with scalar function overload. ---*/ \
167+ template <class U, class S> \
168+ FORCEINLINE auto FUN(const CVecExpr<U, S>& u, decay_t <S> v) RETURNS(EXPR<U, Bcast<S>, S>(u.derived(), Bcast<S>(v))) \
169+ /* !--- Scalar with vector function overload. ---*/ \
170+ template <class S, class V> \
171+ FORCEINLINE auto FUN(decay_t <S> u, const CVecExpr<V, S>& v) RETURNS(EXPR<Bcast<S>, V, S>(Bcast<S>(u), v.derived()))
172+ // clang-format on
171173
172174/* --- std::max/min have issues (because they return by reference).
173175 * fmin and fmax return by value and thus are fine, but they would force
0 commit comments