diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2023-07-26 19:03:47 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2023-07-26 19:04:23 +0000 |
| commit | 7fa27ce4a07f19b07799a767fc29416f3b625afb (patch) | |
| tree | 27825c83636c4de341eb09a74f49f5d38a15d165 /libcxx/include/__numeric/reduce.h | |
| parent | e3b557809604d036af6e00c60f012c2025b59a5e (diff) | |
Diffstat (limited to 'libcxx/include/__numeric/reduce.h')
| -rw-r--r-- | libcxx/include/__numeric/reduce.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libcxx/include/__numeric/reduce.h b/libcxx/include/__numeric/reduce.h index b64df05bc80e..8daa7cf60e25 100644 --- a/libcxx/include/__numeric/reduce.h +++ b/libcxx/include/__numeric/reduce.h @@ -13,6 +13,7 @@ #include <__config> #include <__functional/operations.h> #include <__iterator/iterator_traits.h> +#include <__utility/move.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header @@ -20,12 +21,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD -#if _LIBCPP_STD_VER > 14 +#if _LIBCPP_STD_VER >= 17 template <class _InputIterator, class _Tp, class _BinaryOp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp reduce(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOp __b) { for (; __first != __last; ++__first) - __init = __b(__init, *__first); + __init = __b(std::move(__init), *__first); return __init; } |
