cxx11-cmake-modules in kdereview
Thiago Macieira
thiago at kde.org
Fri Mar 1 17:49:51 GMT 2013
On sexta-feira, 1 de março de 2013 18.28.33, Ivan Čukić wrote:
> > Can we discuss whether such module should be used?
>
> Naturally.
>
> > > Why can't you use the #defines from QtCore?
>
> From my POV:
> - it is not documented - at least, I couldn't find it in Qt 4.8 docs, nor
> 5.0 (might be a fault of qt-project.org's search mechanism)
Right, they are documented only in the header. You have my word that the
Q_COMPILER_* defines will be maintained. A patch providing the documentation
for them would be greatly appreciated.
> - it is not extensible - it covers a limited number of features (for
> example, I don't see a test for nullptr) - with this, the user could test
> any feature desired
It's there: Q_COMPILER_NULLPTR, as well as Q_NULLPTR.
> - it is based on compiler version map - this is a personal preference: I'd
> rather have a feature confirmed by a compile-time test, than having it
> enabled because it is clang version 12.34.56 (war wounds from JS testing
> web browser versions of netscape vs ie instead of doing feature checking :)
> )
Both are compile-time. The Clang ones are even based on Clang itself declaring
whether it supports them, with the __has_feature extension.
Besides, if you want to check whether the given feature was enabled in Qt, you
need to use the same define that was used to enable it. Doing two separate
checks, for example for initializer lists, could spell trouble. If you need to
use the Qt macros anyway in some parts of your code, why not in others?
What's more, they're there. Why not use them?
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20130301/bbc2f2c2/attachment.sig>
More information about the kde-core-devel
mailing list