关于语言特性

keyword: Visual CPP Team, C++ *** Language Features in Visual C++ ***

有些bug是因为对对编译器的特性不熟悉造成的.

不同版本的VS,编译器版本也不同(可以通过cl.exe的输出看见其版本号, 或者 _MSC_VER).

There's the branded version (printed on the box), the internal version (displayed in Help About), and the compiler version (displayed by cl.exe and the _MSC_VER macro - this one is different because our C++ compiler predates the "Visual" in Visual C++).  For example:

VS 2005 == VC8 == _MSC_VER 1400
VS 2008 == VC9 == _MSC_VER 1500
VS 2010 == VC10 == _MSC_VER 1600

正如原文所述, compiler version才是编译器相关的.

而有些语言特性, 就要看(1)compiler是否支持 (2)工程是否支持

所谓工程是否支持, 比如现在使用的ATL/WTL混合的工程, 即使编译器支持, 但是编译的时候, 仍旧不能通过.

这个BUG, 还在寻找… 也许是ATL/WTL中的某些宏, 禁用了这个语言feature?

 

然而, 启用某种语言feature, 需要考虑到 “兼容性” 的问题, 尤其是团队内部使用的 IDE 版本.

原文地址:https://www.cnblogs.com/permanence-practice/p/3853024.html