各个版本的 MSVC 功能列表? [英] List of MSVC features with the respective version?

查看:52
本文介绍了各个版本的 MSVC 功能列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用它们出现的相应版本查找 MSVC 功能列表,以便我可以执行以下操作:

#if defined(_MSC_VER) &&_MSC_VER >X#define MY_INLINE __forceinline#别的#define MY_INLINE 内联#万一

gcc 为例,有一个 所有属性的最低版本.MSVC 是否有类似的东西?

解决方案

本文描述了从 Visual Studio 2015 回到 Visual Studio 2003 的所有重大更改,以及在本文中,术语新行为"或现在"指的是 Visual Studio 2015 及更高版本.术语旧行为"和之前"指的是 Visual Studio 2013 及更早版本:

<小时>

本文介绍了 Visual C++ 中的 C++11/14/17 特性:

<小时>

下表显示了对新 C++ 功能的编译器支持:

<小时>

以下是我发现的其他一些参考资料:

<小时>

此链接总结了 Visual C++ 编译器的编译器特性和标准库特性的 ISO C++03、C++11、C++14、C++17 和草案 C++20 语言标准一致性Studio 2017 及更早版本:

<小时>

以下是有关使用 MSVC 的内部版本编号的信息:><块引用>

预定义的宏_MSC_VER表示主要和次要版本Visual C++ 编译器的编号.宏的值是一个整数最后两位数字表示次要版本号的文字前面的数字表示主要版本号.

从 Visual Studio 2017 开始,_MSC_VER 在以下位置单调递增每个 Visual C++ 工具集更新.因此,例如,版本随 Visual Studio 2017 版本 15.3.0 集一起提供的 MSVC++ 14.1_MSC_VER 到 1911.Microsoft 建议使用 >= 运算符来测试 _MSC_VER 的值.

以下是各种版本的 Visual C++ 编译器的 _MSC_VER 值:

MSC 1.0 _MSC_VER == 100MSC 2.0 _MSC_VER == 200MSC 3.0 _MSC_VER == 300MSC 4.0 _MSC_VER == 400MSC 5.0 _MSC_VER == 500MSC 6.0 _MSC_VER == 600MSC 7.0 _MSC_VER == 700MSVC++ 1.0 _MSC_VER == 800MSVC++ 2.0 _MSC_VER == 900MSVC++ 4.0 _MSC_VER == 1000 (Developer Studio 4.0)MSVC++ 4.2 _MSC_VER == 1020 (Developer Studio 4.2)MSVC++ 5.0 _MSC_VER == 1100(Visual Studio 97 5.0 版)MSVC++ 6.0 _MSC_VER == 1200(Visual Studio 6.0 6.0 版)MSVC++ 7.0 _MSC_VER == 1300(Visual Studio .NET 2002 7.0 版)MSVC++ 7.1 _MSC_VER == 1310(Visual Studio .NET 2003 7.1 版)MSVC++ 8.0 _MSC_VER == 1400(Visual Studio 2005 8.0 版)MSVC++ 9.0 _MSC_VER == 1500(Visual Studio 2008 9.0 版)MSVC++ 10.0 _MSC_VER == 1600(Visual Studio 2010 版本 10.0)MSVC++ 11.0 _MSC_VER == 1700(Visual Studio 2012 版本 11.0)MSVC++ 12.0 _MSC_VER == 1800(Visual Studio 2013 版本 12.0)MSVC++ 14.0 _MSC_VER == 1900(Visual Studio 2015 版本 14.0)MSVC++ 14.1 _MSC_VER == 1910(Visual Studio 2017 版本 15.0)MSVC++ 14.11 _MSC_VER == 1911(Visual Studio 2017 版本 15.3)MSVC++ 14.12 _MSC_VER == 1912(Visual Studio 2017 版本 15.5)MSVC++ 14.13 _MSC_VER == 1913(Visual Studio 2017 版本 15.6)MSVC++ 14.14 _MSC_VER == 1914(Visual Studio 2017 版本 15.7)

I am trying to find a list of MSVC features with the respective version they appeared in so I could do something like this:

#if defined(_MSC_VER) && _MSC_VER > X
#define MY_INLINE __forceinline
#else
#define MY_INLINE inline
#endif

With gcc for example, there is a list of the minimum version for all attributes. Is there something similar for MSVC?

解决方案

This article describes all the breaking changes from Visual Studio 2015 going back to Visual Studio 2003, and in this article the terms "new behavior" or "now" refer to Visual Studio 2015 and later. The terms "old behavior" and "before" refer to Visual Studio 2013 and earlier releases:


This article describes C++11/14/17 features in Visual C++:


The following table presents compiler support for new C++ features:


Here are some other references that I found:


This link summarizes the ISO C++03, C++11, C++14, C++17, and Draft C++20 language standards conformance of compiler features and Standard Library features for the C++ compiler in Visual Studio 2017 and earlier versions:


Here is the information about using Internal Version Numbering of MSVC:

The predefined macro _MSC_VER indicates the major and minor version numbers of the Visual C++ compiler. The macro's value is an integer literal in which the last two digits indicate the minor version number and the preceding digits indicate the major version number.

From Visual Studio 2017, _MSC_VER is incremented monotonically at every Visual C++ toolset update. Thus, for example, the version of MSVC++ 14.1 that ships with Visual Studio 2017 version 15.3.0 sets _MSC_VER to 1911. Microsoft recommends using the >= operator to test the value of _MSC_VER.

Here are values of _MSC_VER for various versions of the Visual C++ compiler:

MSC    1.0   _MSC_VER == 100
MSC    2.0   _MSC_VER == 200
MSC    3.0   _MSC_VER == 300
MSC    4.0   _MSC_VER == 400
MSC    5.0   _MSC_VER == 500
MSC    6.0   _MSC_VER == 600
MSC    7.0   _MSC_VER == 700
MSVC++ 1.0   _MSC_VER == 800
MSVC++ 2.0   _MSC_VER == 900
MSVC++ 4.0   _MSC_VER == 1000 (Developer Studio 4.0)
MSVC++ 4.2   _MSC_VER == 1020 (Developer Studio 4.2)
MSVC++ 5.0   _MSC_VER == 1100 (Visual Studio 97 version 5.0)
MSVC++ 6.0   _MSC_VER == 1200 (Visual Studio 6.0 version 6.0)
MSVC++ 7.0   _MSC_VER == 1300 (Visual Studio .NET 2002 version 7.0)
MSVC++ 7.1   _MSC_VER == 1310 (Visual Studio .NET 2003 version 7.1)
MSVC++ 8.0   _MSC_VER == 1400 (Visual Studio 2005 version 8.0)
MSVC++ 9.0   _MSC_VER == 1500 (Visual Studio 2008 version 9.0)
MSVC++ 10.0  _MSC_VER == 1600 (Visual Studio 2010 version 10.0)
MSVC++ 11.0  _MSC_VER == 1700 (Visual Studio 2012 version 11.0)
MSVC++ 12.0  _MSC_VER == 1800 (Visual Studio 2013 version 12.0)
MSVC++ 14.0  _MSC_VER == 1900 (Visual Studio 2015 version 14.0)
MSVC++ 14.1  _MSC_VER == 1910 (Visual Studio 2017 version 15.0)
MSVC++ 14.11 _MSC_VER == 1911 (Visual Studio 2017 version 15.3)
MSVC++ 14.12 _MSC_VER == 1912 (Visual Studio 2017 version 15.5)
MSVC++ 14.13 _MSC_VER == 1913 (Visual Studio 2017 version 15.6)
MSVC++ 14.14 _MSC_VER == 1914 (Visual Studio 2017 version 15.7)

这篇关于各个版本的 MSVC 功能列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆