我正在尝试使用Microsoft Visual C++编译器(以前的GCC和其他编译器)编译多平台C++项目。使用_MSVC_LANG而不是__cplusplus安全吗?
现在我遇到一些预处理器指令像这样的:
#if __cplusplus < 201103L
// Define some macros of C++11 the code really relies on.
// [...]
#endif
虽然我使用Visual Studio 2015年,__cplusplus
仍然被定义为199711L
。 This post from the Microsoft blog建议检查_MSVC_LANG
。
_MSVC_LANG >= 201402L
不符合C++ 11的程度?
检查* *也,不*代替*(逻辑或)。 –
好的,我编辑了它。 – WolfgangS