<div dir="ltr"><div dir="ltr">On Fri, May 17, 2019 at 12:56 AM Konstantin Tokarev <<a href="mailto:annulen@yandex.ru" target="_blank">annulen@yandex.ru</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
In C++ there is a convention that ugly things should look ugly in code.</blockquote><div><br>Have a reference for that convention?<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Removing element from the middle or beginning of contiguous container is ugly thing. If you need such operation in your code, you should consider using linked list instead, which allows to remove element with one method call (std::list::remove or std::list::remove_if)<br></blockquote><div><br>Yes, because I may need to do it from time to time, so my code has to be ugly. Makes sense ...<br>std::list is for linked lists, not for vectors. My use case may not involve random insertions or removals in the vector, an occasional one - maybe, that in no way means the library should treat me like an idiot who doesn't know what he's doing. I can read the docs, I don't need to fight against the API to do something rather simple.</div></div></div>