[libc++] Algorithms like `copy` and `copy_n` can use batch insertion for insert iterators into containers
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
As far as I can see, its not currently handled if output iterator is a back_inserter. But it is potentially much better to do
```cpp
out._container.insert(_container.end(), b, e) // uninitialized_copy_n or smth inside
```
instead of many .push_backs
In msvc stl its also not handled, but vector of bool is special case
Contributor guide
Research direction
Start by tracing libc++'s copy and copy_n implementations and their back_inserter or insert-iterator handling, including the vector special case mentioned in the issue. Compare the existing per-element insertion path with the proposed container batch insertion, then determine focused tests for supported containers and edge cases. Done means batching is used where valid without changing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100