[Development] Views
Konstantin Shegunov
kshegunov at gmail.com
Fri May 17 00:11:03 CEST 2019
On Fri, May 17, 2019 at 12:56 AM Konstantin Tokarev <annulen at yandex.ru>
wrote:
> In C++ there is a convention that ugly things should look ugly in code.
Have a reference for that convention?
> 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)
>
Yes, because I may need to do it from time to time, so my code has to be
ugly. Makes sense ...
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20190517/20211881/attachment.html>
More information about the Development
mailing list