Looking for A Closed Set of Compiler Versions Ordering Tests with =” and order your tests in decreasing order. For instance, the following snippetĬhecks for compilers released after VS2015, then compilers released after VS2013, then takes an action for all compilers released prior to VS2013. Furthermore, if you have several reference points to compare against in a mutually exclusive manner, we recommend you order your comparisons in decreasing order of the reference values. To test for VC++ updates or releases after a given reference point, use the “ >=” (greater-or-equal) operator to compare _MSC_VER against that known reference value. What we are doing, starting with VS “15”, is to increment the value of _MSC_VER at each update. That continues to be our recommended practice. Tests for any version of the Visual C++ compiler released after VS2015 RTM. Traditionally, developers write conditionally-included pieces of code testing the value of the built-in preprocessor macro _MSC_VER against known values indicating major releases of the Visual C++ compiler. For instance, a program wanting to make use of the C++11 noexcept feature with VC++ would typically write: As a result, it has become necessary for our customers to have a good way to differentiate between updates of VC++ (and not just major versions) within their source code. Thanks to the investments and progress that the Visual C++ Team has been making in the area of ISO C++ implementation conformance, we have been shipping new language features and introducing new conformance changes at a pace never seen before by our customers, in particular in updates to the Visual C++ toolset. Starting with VS “15” Preview 5, the Visual C++ Team is monotonically updating the value of the built-in preprocessor macro _MSC_VER at every Visual C++ toolset update. This blog was written by Gabriel Dos Reis and Mark Levine. Official documentation on Predefined Macros in Visual C++
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |