[Development] QProperty and library coding guide

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Sun Jul 19 13:14:08 CEST 2020


Il 19/07/20 12:51, Oswald Buddenhagen ha scritto:
> - the compiler somehow starts to actually make use of the freedom
>     granted by the fact that QObject is not standard-layout (this, btw, is
>     also the reason why peppe's suggestion to use offsetof doesn't fix
>     UB).

offsetof is conditionally-supported for non standard layout classes in 
C++17.:

> http://eel.is/c++draft/support.types.layout#1.sentence-2


I haven't found any note in GCC/Clang/MSVC docs saying that they won't 
support it in this case, hence it's supported.

> http://eel.is/c++draft/intro.compliance#:behavior,conditionally-supported


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/20200719/9816d31b/attachment.bin>


More information about the Development mailing list