<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/163134>163134</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            possible optimization for copy_n, copy
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          kelbon
      </td>
    </tr>
</table>

<pre>
    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)
```
instead of many .push_backs

In msvc stl its also not handled, but vector of bool is special case
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxMkd9uozwQxZ_G3IyKjIGEXHCRfp8i9Ski2wzBW-NBniGr7NOvTCttpZH_jX18fjqWOTwS4qj6d9X_X9ldFsrjJ0ZHqXI0vcYrw2wzWIYP8DYBIyrzHwRhSCTg95wxSXzBYtMUcYIwA-2y7QJBMFuhDIHBgrP-8x4SYxbMNbwfF0prI8Ekwcb4gnX3CzgUwQxCMJHS11In_VV-25S-0i713VMSGxLm-ktUmeHHGaZJmUGZSzHryoBl80NK6WtILGgnoBlWm15Qbzsv92KUv_79SLDy0wNLPIhtZDqwv2EP8V3gib5w0gyOKBYo3tAHG8Fbxmoa2-nSXmyFY3M-6bY9n5qhWsZG676dB3fuz7Pv5zParhsuU9f602CMs1UYjTZ9o5tWnzrdDLUbpq6xg3bO4NQ3k-o0rjbEOsbnWlN-VIF5x7E5tU3bVdE6jHyka0zC33B0lTEl7DyWR29uf7DqdAws_E9GgkQcN2IOLiLQJmENf6wESjBTBk_b654Kf1lVe47jIrKxaq_K3JS5PYIsu6s9rcrciuz39LZl-oVelLkdZliZ27fb52j-BgAA___T4db6">