[Bug libstdc++/111053] std::ranges::copy is missing important optimizations

pdimov at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Jan 28 09:50:00 GMT 2025


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

Peter Dimov <pdimov at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pdimov at gmail dot com

--- Comment #2 from Peter Dimov <pdimov at gmail dot com> ---
Now I wonder whether replacing `std::ranges::copy(r, std::back_inserter(c))`
with `c.append_range(r)` is an allowed optimization, all things considered.

Unrelated to the above, one additional special case which `std::copy` has and
`std::ranges::copy` doesn't is dedicated support for contiguous iterators, as
pointed out in bug 118647.


More information about the Gcc-bugs mailing list