[Development] QHash for Qt 6

Иван Комиссаров abbapoh at gmail.com
Tue Dec 24 10:43:21 CET 2019


That’s why in Qbs we have «stlutils» header [0]

I think, I already proposed in one of the similar Qt vs std threads an addition of free functions to make life easier with std:: containers. As far as I remember, Thiago’s main argument against using std::vector was that .empty() looks ugly (and I completely agree with that!). 

However, instead of adding
template<class T> bool qIsEmpty(const T &t) { return t.empty(); }
we keep discussing how ugly std is=)

PS: note, that there is std::empty [1] (which can be used with c-arrays as well) in the standard library, so, again, Qt kind of misses feature parity here

[0] https://github.com/qbs/qbs/blob/master/src/lib/corelib/tools/stlutils.h <https://github.com/qbs/qbs/blob/master/src/lib/corelib/tools/stlutils.h>
[1] https://en.cppreference.com/w/cpp/iterator/empty <https://en.cppreference.com/w/cpp/iterator/empty>

> 24 дек. 2019 г., в 12:12, Kevin Kofler <kevin.kofler at chello.at> написал(а):
> 
> Иван Комиссаров wrote:
>> Well, every time I use (or try to use) QStringView I encounter the problem
>> of missing methods/functionality. The same applies to the Qt containers.
> 
> It's funny because I have that issue each time I am forced to work with 
> somebody else's STL containers. :-) (Sometimes, <algorithms> can help, e.g., 
> to find an element in an std::vector, but its arcane syntax with the pair of 
> iterators is a pain compared to just calling a method such as 
> QVector::contains.)
> 
>        Kevin Kofler
> 
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> https://lists.qt-project.org/listinfo/development

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20191224/ccd946e8/attachment.html>


More information about the Development mailing list