14
14
#include < __algorithm/for_each_n_segment.h>
15
15
#include < __config>
16
16
#include < __functional/identity.h>
17
- #include < __functional/invoke.h>
18
17
#include < __iterator/iterator_traits.h>
19
18
#include < __iterator/segmented_iterator.h>
20
19
#include < __type_traits/enable_if.h>
20
+ #include < __type_traits/invoke.h>
21
21
#include < __utility/convert_to_integral.h>
22
22
23
23
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -28,7 +28,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
28
28
29
29
template <class _InputIterator ,
30
30
class _Size ,
31
- class _Function ,
31
+ class _Func ,
32
32
class _Proj ,
33
33
__enable_if_t <!__has_random_access_iterator_category<_InputIterator>::value &&
34
34
(!__is_segmented_iterator<_InputIterator>::value
@@ -38,11 +38,11 @@ template <class _InputIterator,
38
38
// during SFINAE, which is a hard error to be fixed. Once fixed, we should uncomment.
39
39
int > = 0 >
40
40
_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) {
42
42
typedef decltype (std::__convert_to_integral (__orig_n)) _IntegralSize;
43
43
_IntegralSize __n = __orig_n;
44
44
while (__n > 0 ) {
45
- std::invoke (__f, std::invoke (__proj, *__first));
45
+ std::__invoke (__f, std::__invoke (__proj, *__first));
46
46
++__first;
47
47
--__n;
48
48
}
@@ -51,36 +51,36 @@ __for_each_n(_InputIterator __first, _Size __orig_n, _Function& __f, _Proj& __pr
51
51
52
52
template <class _RandIter ,
53
53
class _Size ,
54
- class _Function ,
54
+ class _Func ,
55
55
class _Proj ,
56
56
__enable_if_t <__has_random_access_iterator_category<_RandIter>::value, int > = 0 >
57
57
_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) {
59
59
typedef decltype (std::__convert_to_integral (__orig_n)) _IntegralSize;
60
60
_IntegralSize __n = __orig_n;
61
61
return std::__for_each (__first, __first + __n, __f, __proj);
62
62
}
63
63
64
64
template <class _SegmentedIterator ,
65
65
class _Size ,
66
- class _Function ,
66
+ class _Func ,
67
67
class _Proj ,
68
68
__enable_if_t <!__has_random_access_iterator_category<_SegmentedIterator>::value &&
69
69
__is_segmented_iterator<_SegmentedIterator>::value &&
70
70
__has_random_access_iterator_category<
71
71
typename __segmented_iterator_traits<_SegmentedIterator>::__local_iterator>::value,
72
72
int > = 0 >
73
73
_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 ) {
75
75
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 ));
77
77
}
78
78
79
79
#if _LIBCPP_STD_VER >= 17
80
80
81
- template <class _InputIterator , class _Size , class _Function >
81
+ template <class _InputIterator , class _Size , class _Func >
82
82
inline _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) {
84
84
__identity __proj;
85
85
return std::__for_each_n (__first, __orig_n, __f, __proj);
86
86
}
0 commit comments