[Development] Basing Qt Creator Coding Style on C++ Core Guidelines?
Tobias Hunger
tobias.hunger at gmail.com
Fri Dec 2 14:28:24 CET 2016
Hi Marc,
On Fri, Dec 2, 2016 at 8:22 AM, Marc Mutz <marc.mutz at kdab.com> wrote:
> As you can see, I was not using it on QObject, as, indeed, the ownership there
> is messed up.
It just does not work with the concepts laid out in the GSL, but that
does not make it messed up.
> But we have tons of take*() and take()-like API, where even in auto-tests,
> which presumably were written by people that know the API well, the return
> value was ignored/leaked, making this kind of API a strong case for use of
> owner<>.
Sprinkling owner<> over our code-base will not magically improve any of this.
> If the Qt low-level smart pointer do not support gsl::owner, then we impair
> users that wish to use the GSL in their own code from using it, because Qt
> code will throw false positives.
Everybody is free to use the STL smart pointers and be done with it.
GSL users will be comfortable with those classes.
Considering that you will get a warning from each and every widget in
a dialog you are probably not going to use enforce GSL owner semantics
in a Qt application anyway.
Best Regards,
Tobias
More information about the Development
mailing list