[libcxx-commits] [PATCH] D59705: Hot fix for equal algo
Mikhail Dvorskiy via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Mar 25 02:06:42 PDT 2019
MikeDvorskiy marked an inline comment as done.
MikeDvorskiy added inline comments.
================
Comment at: include/pstl/internal/glue_algorithm_impl.h:750
{
- return equal(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __pstl::internal::pstl_equal());
+ return equal(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __pstl::internal::pstl_equal());
}
----------------
ldionne wrote:
> What problem is this fixing? IIUC, before this patch, we would end up calling `equal(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2)` here and that would be a compiler error because `__pstl::internal::pstl_equal()` is not an iterator. Is that correct?
>
> If so, this change should be accompanied by a test that goes through this code path.
No...
The fact is there is several version of std::equal..
In particular,
equal(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2...
and
equal(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2...
where each sequence has its own length.
So, the error was the code calls the first version with "__first1, __last1, __first2"
Repository:
rPSTL pstl
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59705/new/
https://reviews.llvm.org/D59705
More information about the libcxx-commits
mailing list