@@ -33,14 +33,16 @@ __for_each(_InputIterator __first, _Sent __last, _Function& __f) {
33
33
return std::move (__f);
34
34
}
35
35
36
- // __do_segment acts as a functor for processing individual segments within the __for_each_segment{, _n} algorithms.
37
- template <class _InputIterator , class _Function >
38
- struct __do_segment {
39
- using _Traits _LIBCPP_NODEBUG = __segmented_iterator_traits<_InputIterator>;
36
+ // __segment_processor handles the per-segment processing by applying the user-provided function to each element
37
+ // within the segment. It acts as a functor passed to the segmented iterator algorithm __for_each_segment.
38
+ template <class _SegmentedIterator , class _Function >
39
+ struct __segment_processor {
40
+ using _Traits _LIBCPP_NODEBUG = __segmented_iterator_traits<_SegmentedIterator>;
40
41
41
42
_Function& __func_;
42
43
43
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __do_segment (_Function& __func) : __func_(__func) {}
44
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __segment_processor (_Function& __func)
45
+ : __func_(__func) {}
44
46
45
47
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void
46
48
operator ()(typename _Traits::__local_iterator __lfirst, typename _Traits::__local_iterator __llast) {
@@ -53,7 +55,7 @@ template <class _SegmentedIterator,
53
55
__enable_if_t <__is_segmented_iterator<_SegmentedIterator>::value, int > = 0 >
54
56
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Function
55
57
__for_each (_SegmentedIterator __first, _SegmentedIterator __last, _Function& __func) {
56
- std::__for_each_segment (__first, __last, std::__do_segment <_SegmentedIterator, _Function>(__func));
58
+ std::__for_each_segment (__first, __last, std::__segment_processor <_SegmentedIterator, _Function>(__func));
57
59
return std::move (__func);
58
60
}
59
61
0 commit comments