[Development] Deprecating Q_STATIC_ASSERT_X and Q_STATIC_ASSERT

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Thu Jun 11 13:32:28 CEST 2020


Il 11/06/20 11:11, Edward Welbourne ha scritto:
> 
> That then leaves the question of whether we deprecate in Qt 6 or remove
> these macros.  I shall leave Marc, who I understand as wanting the
> latter option, to make the case for it, lest I misrepresent that case.

I fear the macros are going to be needed anyhow to support pre-C11 
compilers.

Qt itself can stop using them in C++ code (switching over 
static_assert). And I'd say that C++ mode we can assume static_assert 
presence everywhere, although the compiler detection will still be 
needed for C.

Whether the macros should be documented or not: I keep asking, are they 
supposed to be public API? My answer is more towards a "no", but given 
we're keeping them around anyhow for C, I'd say to keep them working 
also for C++.

Maybe we can use some trick to raise a warning for C++ code, but the 
maintenance burden for the C++ version is going to be 0.

A data point: KDE has (only) ~30 hits of Q_STATIC_ASSERT.

My 2 c,
-- 
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4329 bytes
Desc: Firma crittografica S/MIME
URL: <http://lists.qt-project.org/pipermail/development/attachments/20200611/467a1eaa/attachment.bin>


More information about the Development mailing list