[Development] Q_COMPILER_RANGE_FOR not supported by/defined for VS2012 and VS2013 ?
Thiago Macieira
thiago.macieira at intel.com
Mon Feb 29 19:15:13 CET 2016
On segunda-feira, 29 de fevereiro de 2016 18:33:39 PST Michael Möllney wrote:
> What confused me was that
> Q_COMPILER_RANGE_FOR
> is first defined for VS2015, the older ones are not setting this define.
[cut]
> At least this is what can be found on:
> http://en.cppreference.com/w/cpp/compiler_support
> https://msdn.microsoft.com/en-us/library/hh567368.aspx
>
> So is it an error in
> https://github.com/qtproject/qtbase/blob/5.7/src/corelib/global/qcompilerdet
> ection.h#L917 ?
It's intentional. It's buggy in previous versions, so the #define is not
present.
> Is the test
> https://github.com/qtproject/qtbase/blob/5.7/tests/auto/other/compiler/tst_c
> ompiler.cpp#L991 skipped for all VS compilers older than VS2015?
>
> Or does Qt know something about VS2012 and VS2013 that can not be found on
> the two sites I mentioned, so range for should not be used for these...?
Use it only if you can test that it actually works.
The deal for Qt's own code is that the submitter using ranged for must test
with at least one version of the MS compiler before hitting the Stage button.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
More information about the Development
mailing list