Skip to content

Commit 5a375c7

Browse files
committed
rework plus() for perfect forwarding
1 parent c6cb42b commit 5a375c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stan/math/prim/fun/plus.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ namespace math {
1414
* @return result of unary plus of the input.
1515
*/
1616
template <typename T>
17-
inline plain_type_t<T> plus(const T& x) {
18-
return x;
17+
inline T plus(T&& x) {
18+
return std::forward(x);
1919
}
2020

2121
} // namespace math

0 commit comments

Comments
 (0)