Skip to content

Commit 7b1dbd3

Browse files
committed
Remove unnecessary _AlgoPolicy template parameter
1 parent 6af203b commit 7b1dbd3

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

libcxx/include/__algorithm/for_each.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#define _LIBCPP___ALGORITHM_FOR_EACH_H
1212

1313
#include <__algorithm/for_each_segment.h>
14-
#include <__algorithm/iterator_operations.h>
1514
#include <__config>
1615
#include <__iterator/segmented_iterator.h>
1716
#include <__type_traits/enable_if.h>
@@ -26,7 +25,7 @@ _LIBCPP_PUSH_MACROS
2625

2726
_LIBCPP_BEGIN_NAMESPACE_STD
2827

29-
template <class, class _InputIterator, class _Sent, class _Function>
28+
template <class _InputIterator, class _Sent, class _Function>
3029
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Function
3130
__for_each(_InputIterator __first, _Sent __last, _Function& __f) {
3231
for (; __first != __last; ++__first)
@@ -44,12 +43,11 @@ struct _ForeachSegment {
4443

4544
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void
4645
operator()(typename _Traits::__local_iterator __lfirst, typename _Traits::__local_iterator __llast) {
47-
std::__for_each<_ClassicAlgPolicy>(__lfirst, __llast, __func_);
46+
std::__for_each(__lfirst, __llast, __func_);
4847
}
4948
};
5049

51-
template <class,
52-
class _SegmentedIterator,
50+
template <class _SegmentedIterator,
5351
class _Function,
5452
__enable_if_t<__is_segmented_iterator<_SegmentedIterator>::value, int> = 0>
5553
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Function
@@ -61,7 +59,7 @@ __for_each(_SegmentedIterator __first, _SegmentedIterator __last, _Function& __f
6159
template <class _InputIterator, class _Function>
6260
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Function
6361
for_each(_InputIterator __first, _InputIterator __last, _Function __f) {
64-
return std::__for_each<_ClassicAlgPolicy>(__first, __last, __f);
62+
return std::__for_each(__first, __last, __f);
6563
}
6664

6765
_LIBCPP_END_NAMESPACE_STD

libcxx/include/__algorithm/for_each_n.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#define _LIBCPP___ALGORITHM_FOR_EACH_N_H
1212

1313
#include <__algorithm/for_each.h>
14-
#include <__algorithm/iterator_operations.h>
1514
#include <__config>
1615
#include <__iterator/iterator_traits.h>
1716
#include <__iterator/next.h>
@@ -56,7 +55,7 @@ for_each_n(_InputIterator __first, _Size __orig_n, _Function __f) {
5655
typedef decltype(std::__convert_to_integral(__orig_n)) _IntegralSize;
5756
_IntegralSize __n = __orig_n;
5857
_InputIterator __last = std::next(__first, __n);
59-
std::__for_each<_ClassicAlgPolicy>(__first, __last, __f);
58+
std::__for_each(__first, __last, __f);
6059
return __last;
6160
}
6261

libcxx/include/__algorithm/ranges_for_each.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
#include <__algorithm/for_each.h>
1313
#include <__algorithm/in_fun_result.h>
14-
#include <__algorithm/iterator_operations.h>
1514
#include <__config>
1615
#include <__functional/identity.h>
1716
#include <__functional/invoke.h>
@@ -47,7 +46,7 @@ struct __for_each {
4746
auto __n = __last - __first;
4847
auto __end = __first + __n;
4948
auto __f = [&](auto&& __val) { std::invoke(__func, std::invoke(__proj, __val)); };
50-
std::__for_each<_RangeAlgPolicy>(__first, __end, __f);
49+
std::__for_each(__first, __end, __f);
5150
return {std::move(__end), std::move(__func)};
5251
} else {
5352
for (; __first != __last; ++__first)

libcxx/include/__algorithm/ranges_for_each_n.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
#include <__algorithm/for_each.h>
1313
#include <__algorithm/in_fun_result.h>
14-
#include <__algorithm/iterator_operations.h>
1514
#include <__config>
1615
#include <__functional/identity.h>
1716
#include <__functional/invoke.h>
@@ -46,7 +45,7 @@ struct __for_each_n {
4645
if constexpr (forward_iterator<_Iter>) {
4746
auto __last = std::ranges::next(__first, __count);
4847
auto __f = [&](auto&& __val) { std::invoke(__func, std::invoke(__proj, __val)); };
49-
std::__for_each<_RangeAlgPolicy>(__first, __last, __f);
48+
std::__for_each(__first, __last, __f);
5049
return {std::move(__last), std::move(__func)};
5150
} else {
5251
while (__count-- > 0) {

0 commit comments

Comments
 (0)