1414#include < __algorithm/for_each_n_segment.h>
1515#include < __config>
1616#include < __functional/identity.h>
17- #include < __functional/invoke.h>
1817#include < __iterator/iterator_traits.h>
1918#include < __iterator/segmented_iterator.h>
2019#include < __type_traits/enable_if.h>
20+ #include < __type_traits/invoke.h>
2121#include < __utility/convert_to_integral.h>
2222
2323#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -28,7 +28,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2828
2929template <class _InputIterator ,
3030 class _Size ,
31- class _Function ,
31+ class _Func ,
3232 class _Proj ,
3333 __enable_if_t <!__has_random_access_iterator_category<_InputIterator>::value &&
3434 (!__is_segmented_iterator<_InputIterator>::value
@@ -38,11 +38,11 @@ template <class _InputIterator,
3838 // during SFINAE, which is a hard error to be fixed. Once fixed, we should uncomment.
3939 int > = 0 >
4040_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator
41- __for_each_n (_InputIterator __first, _Size __orig_n, _Function & __f, _Proj& __proj) {
41+ __for_each_n (_InputIterator __first, _Size __orig_n, _Func & __f, _Proj& __proj) {
4242 typedef decltype (std::__convert_to_integral (__orig_n)) _IntegralSize;
4343 _IntegralSize __n = __orig_n;
4444 while (__n > 0 ) {
45- std::invoke (__f, std::invoke (__proj, *__first));
45+ std::__invoke (__f, std::__invoke (__proj, *__first));
4646 ++__first;
4747 --__n;
4848 }
@@ -51,36 +51,36 @@ __for_each_n(_InputIterator __first, _Size __orig_n, _Function& __f, _Proj& __pr
5151
5252template <class _RandIter ,
5353 class _Size ,
54- class _Function ,
54+ class _Func ,
5555 class _Proj ,
5656 __enable_if_t <__has_random_access_iterator_category<_RandIter>::value, int > = 0 >
5757_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _RandIter
58- __for_each_n (_RandIter __first, _Size __orig_n, _Function & __f, _Proj& __proj) {
58+ __for_each_n (_RandIter __first, _Size __orig_n, _Func & __f, _Proj& __proj) {
5959 typedef decltype (std::__convert_to_integral (__orig_n)) _IntegralSize;
6060 _IntegralSize __n = __orig_n;
6161 return std::__for_each (__first, __first + __n, __f, __proj);
6262}
6363
6464template <class _SegmentedIterator ,
6565 class _Size ,
66- class _Function ,
66+ class _Func ,
6767 class _Proj ,
6868 __enable_if_t <!__has_random_access_iterator_category<_SegmentedIterator>::value &&
6969 __is_segmented_iterator<_SegmentedIterator>::value &&
7070 __has_random_access_iterator_category<
7171 typename __segmented_iterator_traits<_SegmentedIterator>::__local_iterator>::value,
7272 int > = 0 >
7373_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _SegmentedIterator
74- __for_each_n (_SegmentedIterator __first, _Size __orig_n, _Function & __f, _Proj& __proj ) {
74+ __for_each_n (_SegmentedIterator __first, _Size __orig_n, _Func & __f, _Proj& __p ) {
7575 return std::__for_each_n_segment (
76- __first, __orig_n, std::__segment_processor<_SegmentedIterator, _Function , _Proj>(__f, __proj ));
76+ __first, __orig_n, std::__segment_processor<_SegmentedIterator, _Func , _Proj>(__f, __p ));
7777}
7878
7979#if _LIBCPP_STD_VER >= 17
8080
81- template <class _InputIterator , class _Size , class _Function >
81+ template <class _InputIterator , class _Size , class _Func >
8282inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator
83- for_each_n (_InputIterator __first, _Size __orig_n, _Function __f) {
83+ for_each_n (_InputIterator __first, _Size __orig_n, _Func __f) {
8484 __identity __proj;
8585 return std::__for_each_n (__first, __orig_n, __f, __proj);
8686}
0 commit comments