@@ -3020,11 +3020,16 @@ std::pair<_It1, _It2>
3020
3020
___merge_path_out_lim (_Tag, _ExecutionPolicy&& __exec, _It1 __it_1, _Index1 __n_1, _It2 __it_2, _Index2 __n_2,
3021
3021
_OutIt __it_out, _Index3 __n_out, _Comp __comp)
3022
3022
{
3023
- return __serial_merge_out_lim (__it_1, __it_1 + __n_1, __it_2, __it_2 + __n_2, __it_out, __it_out + __n_out, __comp);
3023
+ // ___merge_path_out_lim is called with reverse order: (2nd sequience, 1st sequience)
3024
+ // __serial_merge_out_lim does merging in direct order: (1st sequience and 2nd sequience).
3025
+ // So, the following call passes 1st sequience 2nd sequience in "a revert maner".
3026
+ return __serial_merge_out_lim (__it_2, __it_2 + __n_2, __it_1, __it_1 + __n_1, __it_out, __it_out + __n_out, __comp);
3024
3027
}
3025
3028
3026
3029
inline constexpr std::size_t __merge_path_cut_off = 2000 ;
3027
3030
3031
+ // Parallel version of ___merge_path_out_lim merges 1st sequience and 2nd sequience in "revert maner":
3032
+ // the identical elements from 2nd sequience are being merged first.
3028
3033
template <typename _IsVector, typename _ExecutionPolicy, typename _It1, typename _Index1, typename _It2,
3029
3034
typename _Index2, typename _OutIt, typename _Index3, typename _Comp>
3030
3035
std::pair<_It1, _It2>
0 commit comments