https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121789

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #1)
> (In reply to Avi Kivity from comment #0)
> > Likely the memcpyable detection web gets confused by the move_iterator
> 
> Yes, I think that is the reason.

IIRC I thought that move_iterator would match this condition:

      else if constexpr (contiguous_iterator<_ForwardIterator>
                           && contiguous_iterator<_InputIterator>)

but its iterator_concept is clamped to be no higher than
random_access_iterator_tag, even if it adapts a contiguous iterator.

The __memcpyable<_Dest, _Src>::__value condition is false because we only
unwrap __normal_iterator and not move_iterator:

      using _Dest = decltype(std::__niter_base(__result));
      using _Src = decltype(std::__niter_base(__first));

We would need to also use __miter_base.

Reply via email to