Skip to content

Commit abc6ea3

Browse files
committed
cannot have extra ; so disable clang-format in section
1 parent 81e10b8 commit abc6ea3

1 file changed

Lines changed: 24 additions & 22 deletions

File tree

Common/include/linear_algebra/vector_expressions.hpp

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -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())); \
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()));
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

Comments
 (0)