[Development] The future of smart pointers in Qt API

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Sun Feb 2 09:07:17 CET 2020


Am 02.02.2020 um 01:00 schrieb Иван Комиссаров:
> I would also like to add the argument about templates. Qt API is still
> incompatible with STL in some places, so one cannot write a template
> function that simply calls STL variant.
> For example:
> QString foo;
> if (std::empty(foo)) // oops, fails to compile because QString misses
> the .empty() method
>
> Of course, in the user code we can just call .isEmpty()… but if we’re
> writing a template function that accepts QString and std::vector, what
> should we call?
> Note that std::string misses .isEmpty() method, so there’s simply no
> common subset that can be used. Ofc, one can check if .size() is 0,
> but I guess more examples can be found (that’s the one I was annoyed
> with).
>
So where is your patch to add this functionality?


Christian


More information about the Development mailing list