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

--- Comment #10 from Marc Glisse <glisse at gcc dot gnu.org> ---
Inserting an InputRange (not even Forward) at the beginning of a vector is
really a misuse of vector. It is true that we can do better than what libstdc++
currently does, though we shouldn't encourage the practice. Trivial idea would
be first to copy the InputRange to some array (either something dynamic like a
vector, or by block to a fixed size buffer), then insert that. Variants include
tricks like inserting the InputRange at the end of the vector, then calling
std::rotate to move it to the right position.

Reply via email to