Skip to content

Commit c877ef9

Browse files
committed
add a missing forward
1 parent e240c08 commit c877ef9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stan/math/prim/functor/apply_scalar_binary.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,8 @@ template <typename F, typename T1, typename T2,
335335
require_stan_scalar_t<T1>* = nullptr,
336336
require_std_vector_vt<is_stan_scalar, T2>* = nullptr>
337337
inline auto apply_scalar_binary(F&& f, T1&& x, T2&& y) {
338-
decltype(auto) y_vec = as_column_vector_or_scalar(y);
339338
using T_return = std::decay_t<decltype(f(x, y[0]))>;
339+
decltype(auto) y_vec = as_column_vector_or_scalar(std::forward<T2>(y));
340340
std::vector<T_return> result(y_vec.size());
341341
Eigen::Map<Eigen::Matrix<T_return, -1, 1>>(result.data(), result.size())
342342
= y_vec.unaryExpr(

0 commit comments

Comments
 (0)