[Development] QVariant and types with throwing dtors
Marc Mutz
marc.mutz at qt.io
Mon Aug 26 19:39:56 CEST 2024
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.
Thanks,
Marc
--
Marc Mutz <marc.mutz at qt.io> (he/his)
Principal Software Engineer
The Qt Company
Erich-Thilo-Str. 10 12489
Berlin, Germany
www.qt.io
Geschäftsführer: Mika Pälsi, Juha Varelius, Jouni Lintunen
Sitz der Gesellschaft: Berlin,
Registergericht: Amtsgericht Charlottenburg,
HRB 144331 B
More information about the Development
mailing list