aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/libcxx/include/__numeric/accumulate.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/libcxx/include/__numeric/accumulate.h')
-rw-r--r--contrib/llvm-project/libcxx/include/__numeric/accumulate.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/contrib/llvm-project/libcxx/include/__numeric/accumulate.h b/contrib/llvm-project/libcxx/include/__numeric/accumulate.h
index 81fc0c2943d9..d75c16ead2f2 100644
--- a/contrib/llvm-project/libcxx/include/__numeric/accumulate.h
+++ b/contrib/llvm-project/libcxx/include/__numeric/accumulate.h
@@ -17,6 +17,9 @@
# pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _InputIterator, class _Tp>
@@ -25,7 +28,7 @@ _Tp
accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
{
for (; __first != __last; ++__first)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
__init = _VSTD::move(__init) + *__first;
#else
__init = __init + *__first;
@@ -39,7 +42,7 @@ _Tp
accumulate(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOperation __binary_op)
{
for (; __first != __last; ++__first)
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
__init = __binary_op(_VSTD::move(__init), *__first);
#else
__init = __binary_op(__init, *__first);
@@ -49,4 +52,6 @@ accumulate(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOpe
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP___NUMERIC_ACCUMULATE_H