diff options
author | AlexSm <alex@ydb.tech> | 2024-03-05 10:40:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-05 12:40:59 +0300 |
commit | 1ac13c847b5358faba44dbb638a828e24369467b (patch) | |
tree | 07672b4dd3604ad3dee540a02c6494cb7d10dc3d /contrib/libs/cxxsupp/libcxx/include/__numeric | |
parent | ffcca3e7f7958ddc6487b91d3df8c01054bd0638 (diff) | |
download | ydb-1ac13c847b5358faba44dbb638a828e24369467b.tar.gz |
Library import 16 (#2433)
Co-authored-by: robot-piglet <robot-piglet@yandex-team.com>
Co-authored-by: deshevoy <deshevoy@yandex-team.com>
Co-authored-by: robot-contrib <robot-contrib@yandex-team.com>
Co-authored-by: thegeorg <thegeorg@yandex-team.com>
Co-authored-by: robot-ya-builder <robot-ya-builder@yandex-team.com>
Co-authored-by: svidyuk <svidyuk@yandex-team.com>
Co-authored-by: shadchin <shadchin@yandex-team.com>
Co-authored-by: robot-ratatosk <robot-ratatosk@yandex-team.com>
Co-authored-by: innokentii <innokentii@yandex-team.com>
Co-authored-by: arkady-e1ppa <arkady-e1ppa@yandex-team.com>
Co-authored-by: snermolaev <snermolaev@yandex-team.com>
Co-authored-by: dimdim11 <dimdim11@yandex-team.com>
Co-authored-by: kickbutt <kickbutt@yandex-team.com>
Co-authored-by: abdullinsaid <abdullinsaid@yandex-team.com>
Co-authored-by: korsunandrei <korsunandrei@yandex-team.com>
Co-authored-by: petrk <petrk@yandex-team.com>
Co-authored-by: miroslav2 <miroslav2@yandex-team.com>
Co-authored-by: serjflint <serjflint@yandex-team.com>
Co-authored-by: akhropov <akhropov@yandex-team.com>
Co-authored-by: prettyboy <prettyboy@yandex-team.com>
Co-authored-by: ilikepugs <ilikepugs@yandex-team.com>
Co-authored-by: hiddenpath <hiddenpath@yandex-team.com>
Co-authored-by: mikhnenko <mikhnenko@yandex-team.com>
Co-authored-by: spreis <spreis@yandex-team.com>
Co-authored-by: andreyshspb <andreyshspb@yandex-team.com>
Co-authored-by: dimaandreev <dimaandreev@yandex-team.com>
Co-authored-by: rashid <rashid@yandex-team.com>
Co-authored-by: robot-ydb-importer <robot-ydb-importer@yandex-team.com>
Co-authored-by: r-vetrov <r-vetrov@yandex-team.com>
Co-authored-by: ypodlesov <ypodlesov@yandex-team.com>
Co-authored-by: zaverden <zaverden@yandex-team.com>
Co-authored-by: vpozdyayev <vpozdyayev@yandex-team.com>
Co-authored-by: robot-cozmo <robot-cozmo@yandex-team.com>
Co-authored-by: v-korovin <v-korovin@yandex-team.com>
Co-authored-by: arikon <arikon@yandex-team.com>
Co-authored-by: khoden <khoden@yandex-team.com>
Co-authored-by: psydmm <psydmm@yandex-team.com>
Co-authored-by: robot-javacom <robot-javacom@yandex-team.com>
Co-authored-by: dtorilov <dtorilov@yandex-team.com>
Co-authored-by: sennikovmv <sennikovmv@yandex-team.com>
Co-authored-by: hcpp <hcpp@ydb.tech>
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/include/__numeric')
14 files changed, 224 insertions, 25 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/accumulate.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/accumulate.h index 81fc0c2943..d75c16ead2 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__numeric/accumulate.h +++ b/contrib/libs/cxxsupp/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 diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/adjacent_difference.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/adjacent_difference.h index 57e2f5b280..4b06f9f29f 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__numeric/adjacent_difference.h +++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/adjacent_difference.h @@ -18,6 +18,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template <class _InputIterator, class _OutputIterator> @@ -32,7 +35,7 @@ adjacent_difference(_InputIterator __first, _InputIterator __last, _OutputIterat for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result) { typename iterator_traits<_InputIterator>::value_type __val(*__first); -#if _LIBCPP_STD_VER > 17 +#if _LIBCPP_STD_VER >= 20 *__result = __val - _VSTD::move(__acc); #else *__result = __val - __acc; @@ -56,7 +59,7 @@ adjacent_difference(_InputIterator __first, _InputIterator __last, _OutputIterat for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result) { typename iterator_traits<_InputIterator>::value_type __val(*__first); -#if _LIBCPP_STD_VER > 17 +#if _LIBCPP_STD_VER >= 20 *__result = __binary_op(__val, _VSTD::move(__acc)); #else *__result = __binary_op(__val, __acc); @@ -69,4 +72,6 @@ adjacent_difference(_InputIterator __first, _InputIterator __last, _OutputIterat _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___NUMERIC_ADJACENT_DIFFERENCE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/exclusive_scan.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/exclusive_scan.h index d02e126b53..b6091f153a 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__numeric/exclusive_scan.h +++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/exclusive_scan.h @@ -18,9 +18,12 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD -#if _LIBCPP_STD_VER > 14 +#if _LIBCPP_STD_VER >= 17 template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator @@ -46,8 +49,10 @@ exclusive_scan(_InputIterator __first, _InputIterator __last, _OutputIterator __ return _VSTD::exclusive_scan(__first, __last, __result, __init, _VSTD::plus<>()); } -#endif // _LIBCPP_STD_VER > 14 +#endif // _LIBCPP_STD_VER >= 17 _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___NUMERIC_EXCLUSIVE_SCAN_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/gcd_lcm.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/gcd_lcm.h index 5a3f81b695..1e5ab5713d 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__numeric/gcd_lcm.h +++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/gcd_lcm.h @@ -28,7 +28,7 @@ _LIBCPP_PUSH_MACROS _LIBCPP_BEGIN_NAMESPACE_STD -#if _LIBCPP_STD_VER > 14 +#if _LIBCPP_STD_VER >= 17 template <typename _Result, typename _Source, bool _IsSigned = is_signed<_Source>::value> struct __ct_abs; @@ -87,7 +87,7 @@ lcm(_Tp __m, _Up __n) using _Rp = common_type_t<_Tp,_Up>; _Rp __val1 = __ct_abs<_Rp, _Tp>()(__m) / _VSTD::gcd(__m, __n); _Rp __val2 = __ct_abs<_Rp, _Up>()(__n); - _LIBCPP_ASSERT((numeric_limits<_Rp>::max() / __val1 > __val2), "Overflow in lcm"); + _LIBCPP_ASSERT_UNCATEGORIZED((numeric_limits<_Rp>::max() / __val1 > __val2), "Overflow in lcm"); return __val1 * __val2; } diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/inclusive_scan.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/inclusive_scan.h index e5bf5ac5b7..bd96344602 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__numeric/inclusive_scan.h +++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/inclusive_scan.h @@ -21,7 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD -#if _LIBCPP_STD_VER > 14 +#if _LIBCPP_STD_VER >= 17 template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator @@ -53,7 +53,7 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator inclusiv return _VSTD::inclusive_scan(__first, __last, __result, _VSTD::plus<>()); } -#endif // _LIBCPP_STD_VER > 14 +#endif // _LIBCPP_STD_VER >= 17 _LIBCPP_END_NAMESPACE_STD diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/inner_product.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/inner_product.h index e3d68c04c2..14144257ea 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__numeric/inner_product.h +++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/inner_product.h @@ -17,6 +17,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template <class _InputIterator1, class _InputIterator2, class _Tp> @@ -25,7 +28,7 @@ _Tp inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _Tp __init) { for (; __first1 != __last1; ++__first1, (void) ++__first2) -#if _LIBCPP_STD_VER > 17 +#if _LIBCPP_STD_VER >= 20 __init = _VSTD::move(__init) + *__first1 * *__first2; #else __init = __init + *__first1 * *__first2; @@ -40,7 +43,7 @@ inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 _Tp __init, _BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2) { for (; __first1 != __last1; ++__first1, (void) ++__first2) -#if _LIBCPP_STD_VER > 17 +#if _LIBCPP_STD_VER >= 20 __init = __binary_op1(_VSTD::move(__init), __binary_op2(*__first1, *__first2)); #else __init = __binary_op1(__init, __binary_op2(*__first1, *__first2)); @@ -50,4 +53,6 @@ inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___NUMERIC_INNER_PRODUCT_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/midpoint.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/midpoint.h index bac3642cbd..5325f5e6b3 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__numeric/midpoint.h +++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/midpoint.h @@ -33,7 +33,7 @@ _LIBCPP_PUSH_MACROS _LIBCPP_BEGIN_NAMESPACE_STD -#if _LIBCPP_STD_VER > 17 +#if _LIBCPP_STD_VER >= 20 template <class _Tp> _LIBCPP_INLINE_VISIBILITY constexpr enable_if_t<is_integral_v<_Tp> && !is_same_v<bool, _Tp> && !is_null_pointer_v<_Tp>, _Tp> @@ -86,7 +86,7 @@ midpoint(_Fp __a, _Fp __b) noexcept __a/2 + __b/2; // otherwise correctly rounded } -#endif // _LIBCPP_STD_VER > 17 +#endif // _LIBCPP_STD_VER >= 20 _LIBCPP_END_NAMESPACE_STD diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/partial_sum.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/partial_sum.h index 97cca582c0..76349750b6 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__numeric/partial_sum.h +++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/partial_sum.h @@ -18,6 +18,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template <class _InputIterator, class _OutputIterator> @@ -31,7 +34,7 @@ partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __res *__result = __t; for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result) { -#if _LIBCPP_STD_VER > 17 +#if _LIBCPP_STD_VER >= 20 __t = _VSTD::move(__t) + *__first; #else __t = __t + *__first; @@ -54,7 +57,7 @@ partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __res *__result = __t; for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result) { -#if _LIBCPP_STD_VER > 17 +#if _LIBCPP_STD_VER >= 20 __t = __binary_op(_VSTD::move(__t), *__first); #else __t = __binary_op(__t, *__first); @@ -67,4 +70,6 @@ partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __res _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___NUMERIC_PARTIAL_SUM_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/pstl_reduce.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/pstl_reduce.h new file mode 100644 index 0000000000..163e0078e1 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/pstl_reduce.h @@ -0,0 +1,73 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___NUMERIC_PSTL_REDUCE_H +#define _LIBCPP___NUMERIC_PSTL_REDUCE_H + +#include <__algorithm/pstl_frontend_dispatch.h> +#include <__config> +#include <__functional/identity.h> +#include <__iterator/iterator_traits.h> +#include <__numeric/pstl_transform_reduce.h> +#include <__type_traits/is_execution_policy.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class> +void __pstl_reduce(); + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _Tp, + class _BinaryOperation = plus<>, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI _Tp +reduce(_ExecutionPolicy&& __policy, + _ForwardIterator __first, + _ForwardIterator __last, + _Tp __init, + _BinaryOperation __op = {}) { + return std::__pstl_frontend_dispatch( + _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_reduce), + [&__policy](_ForwardIterator __g_first, _ForwardIterator __g_last, _Tp __g_init, _BinaryOperation __g_op) { + return std::transform_reduce( + __policy, std::move(__g_first), std::move(__g_last), std::move(__g_init), std::move(__g_op), __identity{}); + }, + std::move(__first), + std::move(__last), + std::move(__init), + std::move(__op)); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI __iter_value_type<_ForwardIterator> +reduce(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last) { + return std::__pstl_frontend_dispatch( + _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_reduce), + [&__policy](_ForwardIterator __g_first, _ForwardIterator __g_last) { + return std::reduce(__policy, __g_first, __g_last, __iter_value_type<_ForwardIterator>()); + }, + std::move(__first), + std::move(__last)); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 + +#endif // _LIBCPP___NUMERIC_PSTL_REDUCE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/pstl_transform_reduce.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/pstl_transform_reduce.h new file mode 100644 index 0000000000..b7c9d8d288 --- /dev/null +++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/pstl_transform_reduce.h @@ -0,0 +1,100 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___NUMERIC_PSTL_TRANSFORM_REDUCE_H +#define _LIBCPP___NUMERIC_PSTL_TRANSFORM_REDUCE_H + +#include <__algorithm/pstl_backend.h> +#include <__algorithm/pstl_frontend_dispatch.h> +#include <__config> +#include <__functional/operations.h> +#include <__numeric/transform_reduce.h> +#include <__type_traits/is_execution_policy.h> +#include <__utility/move.h> +#include <__utility/terminate_on_exception.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _ExecutionPolicy, + class _ForwardIterator1, + class _ForwardIterator2, + class _Tp, + class _BinaryOperation1, + class _BinaryOperation2, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI _Tp transform_reduce( + _ExecutionPolicy&&, + _ForwardIterator1 __first1, + _ForwardIterator1 __last1, + _ForwardIterator2 __first2, + _Tp __init, + _BinaryOperation1 __reduce, + _BinaryOperation2 __transform) { + using _Backend = typename __select_backend<_RawPolicy>::type; + return std::__pstl_transform_reduce<_RawPolicy>( + _Backend{}, + std::move(__first1), + std::move(__last1), + std::move(__first2), + std::move(__init), + std::move(__reduce), + std::move(__transform)); +} + +// This overload doesn't get a customization point because it's trivial to detect (through e.g. +// __is_trivial_plus_operation) when specializing the more general variant, which should always be preferred +template <class _ExecutionPolicy, + class _ForwardIterator1, + class _ForwardIterator2, + class _Tp, + enable_if_t<is_execution_policy_v<__remove_cvref_t<_ExecutionPolicy>>, int> = 0> +_LIBCPP_HIDE_FROM_ABI _Tp transform_reduce( + _ExecutionPolicy&& __policy, + _ForwardIterator1 __first1, + _ForwardIterator1 __last1, + _ForwardIterator2 __first2, + _Tp __init) { + return std::transform_reduce(__policy, __first1, __last1, __first2, __init, plus{}, multiplies{}); +} + +template <class _ExecutionPolicy, + class _ForwardIterator, + class _Tp, + class _BinaryOperation, + class _UnaryOperation, + class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>, + enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> +_LIBCPP_HIDE_FROM_ABI _Tp transform_reduce( + _ExecutionPolicy&&, + _ForwardIterator __first, + _ForwardIterator __last, + _Tp __init, + _BinaryOperation __reduce, + _UnaryOperation __transform) { + using _Backend = typename __select_backend<_RawPolicy>::type; + return std::__pstl_transform_reduce<_RawPolicy>( + _Backend{}, + std::move(__first), + std::move(__last), + std::move(__init), + std::move(__reduce), + std::move(__transform)); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 + +#endif // _LIBCPP___NUMERIC_PSTL_TRANSFORM_REDUCE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/reduce.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/reduce.h index b64df05bc8..8daa7cf60e 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__numeric/reduce.h +++ b/contrib/libs/cxxsupp/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; } diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/transform_exclusive_scan.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/transform_exclusive_scan.h index afbcdb8db8..3d5574c7d0 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__numeric/transform_exclusive_scan.h +++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/transform_exclusive_scan.h @@ -18,7 +18,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD -#if _LIBCPP_STD_VER > 14 +#if _LIBCPP_STD_VER >= 17 template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp, class _UnaryOp> @@ -42,7 +42,7 @@ transform_exclusive_scan(_InputIterator __first, _InputIterator __last, return __result; } -#endif // _LIBCPP_STD_VER > 14 +#endif // _LIBCPP_STD_VER >= 17 _LIBCPP_END_NAMESPACE_STD diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/transform_inclusive_scan.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/transform_inclusive_scan.h index c050041bc1..ee9168928a 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__numeric/transform_inclusive_scan.h +++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/transform_inclusive_scan.h @@ -19,7 +19,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD -#if _LIBCPP_STD_VER > 14 +#if _LIBCPP_STD_VER >= 17 template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp, class _UnaryOp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 @@ -51,7 +51,7 @@ transform_inclusive_scan(_InputIterator __first, _InputIterator __last, return __result; } -#endif // _LIBCPP_STD_VER > 14 +#endif // _LIBCPP_STD_VER >= 17 _LIBCPP_END_NAMESPACE_STD diff --git a/contrib/libs/cxxsupp/libcxx/include/__numeric/transform_reduce.h b/contrib/libs/cxxsupp/libcxx/include/__numeric/transform_reduce.h index d997521a95..7e47f34d37 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__numeric/transform_reduce.h +++ b/contrib/libs/cxxsupp/libcxx/include/__numeric/transform_reduce.h @@ -20,13 +20,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD -#if _LIBCPP_STD_VER > 14 +#if _LIBCPP_STD_VER >= 17 template <class _InputIterator, class _Tp, class _BinaryOp, class _UnaryOp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp transform_reduce(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOp __b, _UnaryOp __u) { for (; __first != __last; ++__first) - __init = __b(__init, __u(*__first)); + __init = __b(std::move(__init), __u(*__first)); return __init; } @@ -36,7 +36,7 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp transform_reduce(_In _InputIterator2 __first2, _Tp __init, _BinaryOp1 __b1, _BinaryOp2 __b2) { for (; __first1 != __last1; ++__first1, (void)++__first2) - __init = __b1(__init, __b2(*__first1, *__first2)); + __init = __b1(std::move(__init), __b2(*__first1, *__first2)); return __init; } |