@@ -146,28 +146,28 @@ 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+ #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())); \
165+ /* !--- Vector with scalar function overload. --- */ \
166+ template < class U , class S > \
167+ FORCEINLINE auto FUN ( const CVecExpr<U, S>& u, decay_t <S> v) RETURNS(EXPR<U, Bcast<S>, S>(u.derived(), Bcast<S>(v))); \
168+ /* !--- Scalar with vector function overload. --- */ \
169+ template < class S , class V > \
170+ FORCEINLINE auto FUN ( decay_t <S> u, const CVecExpr<V, S>& v) RETURNS(EXPR<Bcast<S>, V, S>(Bcast<S>(u), v.derived()));
171171
172172/* --- std::max/min have issues (because they return by reference).
173173 * fmin and fmax return by value and thus are fine, but they would force
0 commit comments