diff options
Diffstat (limited to 'src/common/algorithm.h')
| -rw-r--r-- | src/common/algorithm.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/algorithm.h b/src/common/algorithm.h index 055dca142..c27c9241d 100644 --- a/src/common/algorithm.h +++ b/src/common/algorithm.h | |||
| @@ -27,7 +27,7 @@ template <class ForwardIt, class T, class Compare = std::less<>> | |||
| 27 | template <typename T, typename Func, typename... Args> | 27 | template <typename T, typename Func, typename... Args> |
| 28 | T FoldRight(T initial_value, Func&& func, Args&&... args) { | 28 | T FoldRight(T initial_value, Func&& func, Args&&... args) { |
| 29 | T value{initial_value}; | 29 | T value{initial_value}; |
| 30 | const auto high_func = [&value, &func]<typename T>(T x) { value = func(value, x); }; | 30 | const auto high_func = [&value, &func]<typename U>(U x) { value = func(value, x); }; |
| 31 | (std::invoke(high_func, std::forward<Args>(args)), ...); | 31 | (std::invoke(high_func, std::forward<Args>(args)), ...); |
| 32 | return value; | 32 | return value; |
| 33 | } | 33 | } |