[libcxx-commits] [libcxx] [libc++] Fix uninitialized algorithms when using unconstrained comparison operators (PR #69373)
via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Oct 17 13:43:24 PDT 2023
================
@@ -232,8 +233,8 @@ struct __fn {
operator()(_InputIterator __ifirst, iter_difference_t<_InputIterator> __n,
_OutputIterator __ofirst, _Sentinel __olast) const {
using _ValueType = remove_reference_t<iter_reference_t<_OutputIterator>>;
- auto __result = _VSTD::__uninitialized_copy_n<_ValueType>(_VSTD::move(__ifirst), __n,
- _VSTD::move(__ofirst), _VSTD::move(__olast));
+ auto __stop = [&__olast](auto&& __out_iter) { return __out_iter == __olast; };
----------------
phyBrackets wrote:
better name could be `__end_predicate` or `__stop_copying`🤔 ?
https://github.com/llvm/llvm-project/pull/69373
More information about the libcxx-commits
mailing list