c++ - Visual Studio 是否支持新的 C/C++ 标准?

标签 c++ visual-studio visual-c++ c++11 c99

我一直在阅读有关 C99 和 C++11 以及所有这些完全甜蜜的东西,它们正在被添加到语言标准中,将来可能会很好用。然而,我们目前在 Visual Studio 中编写 C++ 的土地上苦苦挣扎。

标准中的任何新内容是否会添加到 Visual Studio 中,或者 Microsoft 是否更有兴趣添加新的 C# 变体来做到这一点?

编辑:除了接受的答案,我还找到了 Visual C++ 团队博客:

http://blogs.msdn.com/vcblog/

特别是其中的这篇文章:

https://web.archive.org/web/20190109064523/https://blogs.msdn.microsoft.com/vcblog/2008/02/22/tr1-slide-decks/

非常有用。谢谢!

最佳答案

MS 对此进行了一系列公开回复,其中大部分都在指责用户。喜欢这个:

https://devblogs.microsoft.com/cppblog/iso-c-standard-update/

Now, the Visual C++ compiler team receives the occasionally question as to why we haven’t implemented C99. It’s really based on interest from our users. Where we’ve received many requests for certain C99 features, we’ve tried to implement them (or analogues). A couple examples are variadic macros, long long, __pragma, __FUNCTION__, and __restrict. If there are other C99 features that you’d find useful in your work, let us know! We don’t hear much from our C users, so speak up and make yourselves heard

http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=345360

Hi: unfortunately the overwhelming feadback we get from the majority of our users is that they would prefer that we focus on C++-0x instead of on C-99. We have "cherry-picked" certain popular C-99 features (variadic macros, long long) but beyond this we are unlikely to do much more in the C-99 space (at least in the short-term).

Jonathan Caves

Visual C++ Compiler Team.

这是一种非常可悲的情况,但如果您怀疑 MS 想要锁定用户,这也是有道理的:将现代基于 gcc 的代码移植到 MSVC 中变得非常困难,至少我觉得这非常痛苦。

但存在一种解决方法:请注意,英特尔在这方面更加开明。英特尔 C 编译器可以处理 C99 代码,甚至具有与 gcc 相同的标志,从而更容易在平台之间移植代码。此外,英特尔编译器在 Visual Studio 中工作。因此,通过废弃 MS COMPILER,您仍然可以使用您认为具有某种值(value)的 MS IDE,并尽情使用 C99。

老实说,一个更明智的方法是转移到英特尔 CC 或 gcc,并在您的编程环境中使用 Eclipse。根据我的经验,跨 Windows-Linux-Solaris-AIX-etc 的代码可移植性通常很重要,不幸的是,MS 工具根本不支持这一点。

关于c++ - Visual Studio 是否支持新的 C/C++ 标准?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/146381/

相关文章:

c++ - 阻止 cin 继续接受输入

wpf - 如何手动重新加载 WPF 的 Visual Studio 设计器

visual-studio - 与 visual studio 2017 和 ssis 作斗争

python - py2exe寻找VC9.0

C++ "vector iterator not decrementable"?

c++ - 我的一些函数出现 "undefined reference"错误,我不知道为什么

c++ - 我想使用 strcpy_s 将字符串转换为 char,但它给出了大小错误

visual-studio - 如何避免使用Visual Studio和Docker容器的API出现连接拒绝错误?

c++ - dll shell 扩展如何知道要执行的程序位置?

c++ - 使用复制构造函数且存在虚函数时出现错误 "recursive on all control paths"