[Development] QVariant and types with throwing dtors
Thiago Macieira
thiago.macieira at intel.com
Mon Aug 26 19:49:27 CEST 2024
On Monday 26 August 2024 10:39:56 GMT-7 Marc Mutz via Development wrote:
> On 26.08.24 08:43, Ville Voutilainen wrote:
> >> IMHO, (1) is not an acceptable option. Us C++ professionals having
> >> identified this problem after years of it lying dormant, it behooves us,
> >> at the very least, to educate our users about this, e.g. by adding docs,
> >> and maybe a qWarning() in ~QVariant(), if we don't do (2).
> >
> > If it's not an issue, why is (1) unacceptable?
>
> It's _guesstimated_ to be no issue, based on sampling qt5.git and
> qt-creator.git.
>
> What is unacceptable in (1) (doing nothing) is not even _informing_
> users about what we found¹, so _they_ can decide for themselves what to do.
>
> ¹ neither at compile-time, nor runtime, nor coding time (static checker)
> nor at documentation reading time.
>
> We want our APIs to be easy to use and hard to abuse. It's easy to abuse
> QVariant in this way, so it behooves us to try to do _something_ about it.
A runtime warning is unacceptable because it adds to the cost of the 99.99%
who don't have a throwing destructor.
A compile-time warning implies having a way to disable it with "I know that,
just ignore it" which is maintenance for us. My problem with this is the cost
on us, to maintain such a thing that has never been a problem and likely never
will.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Principal Engineer - Intel DCAI Platform & System Engineering
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5152 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20240826/14085e89/attachment.bin>
More information about the Development
mailing list