[Development] RFC: handling of C++ feature test macros
giuseppe.dangelo at kdab.com
Wed Sep 18 01:05:34 CEST 2019
Il 09/09/19 14:44, Mutz, Marc via Development ha scritto:
> 3. The wider C++ community seems to settle for non-versioned checks if
> the initial version is sufficient, which may mean that Qt introduces an
> impedance mismatch for pre-standard values where Qt checks the version
> and users and other libraries do not. If there actually are non-standard
> implementation who nonetheless defined the standard feature-test macro,
> but with a lower value, Qt and the user will not agree on the presence
> of a feature.
Let me disagree a bit with this proposal: to me the presence of the
version check indicates that the intended meaning was for the code to
work with the feature as published in the Standard, and not with any
pre-release that a compiler may be implementing.
While I agree that at the moment it has virtually never happened, it
doesn't mean it couldn't happen in the future. Even today we have
compilers such as MSVC with "living on the edge" compile flags
(/c++latest). Our users can use those, and thus potentially trigger
codepaths that on their specific compiler version are implemented in a
So, how academic (I think should I say paranoid...) do we want to be?
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...
Size: 4329 bytes
Desc: Firma crittografica S/MIME
More information about the Development