Visual Studio 2012 中的 C++11 功能

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7421825/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 16:54:50  来源:igfitidea点击:

C++11 features in Visual Studio 2012

c++visual-c++c++11visual-c++-2012

提问by HighCommander4

A preview version of Visual Studio 2012 (the next version after VS2010) is now available.

Visual Studio 2012 预览版(VS2010 之后的下一个版本)现已推出

Does anyone know what new C++11 features it supports? (I'm not in a position to try it out at the moment).

有谁知道它支持哪些新的 C++11 特性?(我目前无法尝试)。

采纳答案by Joel Coehoorn

It's worth noting that Visual Studio 2010 already had quite a bit of early C++11 support. So to summarize what is already linked to in other answers, here is what is new in Visual Studio 11 that was not part of Visual Studio 2010:

值得注意的是,Visual Studio 2010 已经有相当多的早期 C++11 支持。因此,总结一下其他答案中已经链接的内容,这里是 Visual Studio 11 中不属于 Visual Studio 2010 的新内容:

In early November 2012, Microsoft announcedthe Visual C++ Compiler November 2012 CTP, which adds more C++11 functionality to Visual Studio 2012:

2012 年 11 月上旬,Microsoft发布Visual C++ Compiler 2012 年 11 月 CTP,它为 Visual Studio 2012 添加了更多 C++11 功能:

回答by Drahakar

Hereis the list of feature of the new visual studio version and hereis the list of what all compilers support

这里是新的Visual Studio版本功能的列表,并在这里是什么都编译器支持列表

回答by Alexandre C.

There is a list there. What strikes me the most is the features which are still missing:

有一个列表存在。最让我印象深刻的是仍然缺少的功能:

  • They saidthey would implement variadic templates as a priority and they didn't.
  • We will still have to declare move constructors by hand for many classes, since there is no delegating constructors.
  • Inheriting constructors aren't present, and this would really be needed for some code
  • No uniform initialization, in particular no initializer lists. This sucks when you have used them with g++.
  • Still no correct thread local storage. So you're stuck with boost::thread_specific_ptrfor a while.
  • 他们说他们会优先实现可变参数模板,但他们没有。
  • 我们仍然需要为许多类手动声明移动构造函数,因为没有委托构造函数。
  • 不存在继承构造函数,某些代码确实需要这样做
  • 没有统一的初始化,特别是没有初始化列表。当您将它们与 g++ 一起使用时,这很糟糕。
  • 仍然没有正确的线程本地存储。所以你被困boost::thread_specific_ptr了一段时间。

All the other features which are yet missing are mainly stuff you can live without. What I list here is just what nags me everyday when working with VS10. It's just so irritating that they didn't work on the compiler at all.

尚未缺少的所有其他功能主要是您可以没有的东西。我在这里列出的正是使用 VS10 时每天困扰我的事情。他们根本没有在编译器上工作,真是太令人恼火了。

EDIT:I shall also add that emplace_back(one great feature for the standard library containers) isn't correctly implemented.

编辑:我还要补充一点emplace_back(标准库容器的一项重要功能)没有正确实现。

回答by Kate Gregory

During GoingNative in Feb 2012, STL announced that range-for will be in VS11 starting with the beta, which is expected Feb 29th. A recording of the talkis available. "The Reveal" is at the one-hour 38 minute mark.

在 2012 年 2 月的 GoingNative 期间,STL 宣布 range-for 将在 VS11 中从测试版开始,预计将于 2 月 29 日发布。提供谈话录音。“The Reveal”是在1小时38分钟的标记处。

回答by Abhinav

Try this video by Herb Sutter. This fellow dont need introduction!!!

试试 Herb Sutter 的这个视频。这家伙不用介绍!!!

http://channel9.msdn.com/Events/BUILD/BUILD2011/TOOL-835T

http://channel9.msdn.com/Events/BUILD/BUILD2011/TOOL-835T