math_util: rvalue references for std::forward

This commit is contained in:
MerryMage 2018-04-08 10:37:11 +01:00
parent a2f8cdf0a3
commit be907a61f7

View file

@ -16,7 +16,7 @@ namespace Common {
* do not work when the /permissive- flag is enabled. * do not work when the /permissive- flag is enabled.
*/ */
template<typename T, typename... Ts> template<typename T, typename... Ts>
constexpr T Sum(T first, Ts ...rest) { constexpr T Sum(T first, Ts&&... rest) {
if constexpr (sizeof...(rest) == 0) { if constexpr (sizeof...(rest) == 0) {
return first; return first;
} else { } else {