Visual Studio support for new C / C++ standards?

2018-12-31 21:43发布

I keep reading about C99 and C++11 and all these totally sweet things that are getting added to the language standard that might be nice to use someday. However, we currently languish in the land of writing C++ in Visual Studio.

Will any of the new stuff in the standard ever get added to visual studio, or is Microsoft more interested in adding new C# variants to do that?

Edit: In addition to the accepted answer, I found the Visual C++ team blog:

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

And specifically, this post in it:

http://blogs.msdn.com/vcblog/archive/2008/02/22/tr1-slide-decks.aspx

Very useful. Thanks!

12条回答
流年柔荑漫光年
2楼-- · 2018-12-31 22:19

A more recent post about MSVC's C++11 feature compatibility for MSVC 2010 and 2011 is now online.

查看更多
笑指拈花
3楼-- · 2018-12-31 22:20

Starting from VC2013 preview 1, C99, a more diversified set of C++11 and some newly introduced C++14 standards are supported. Checkout the official blog for more details: http://blogs.msdn.com/b/vcblog/archive/2013/06/27/what-s-new-for-visual-c-developers-in-vs2013-preview.aspx

Update:

From https://news.ycombinator.com/item?id=9434483 (Stephan T Lavavej aka: STL is maintainer of STL @VC team):

Specifically, in 2015 our C99 Standard Library implementation is complete, except for tgmath.h (irrelevant in C++) and the CX_LIMITED_RANGE/FP_CONTRACT pragma macros.

Check this post out for details: http://blogs.msdn.com/b/vcblog/archive/2015/04/29/c-11-14-17-features-in-vs-2015-rc.aspx.

查看更多
有味是清欢
4楼-- · 2018-12-31 22:20

Updated information on this:

There is now (10 Nov 2008) a "Community Tech Preview" (CTP) of VS2010 which contains a preview of VC10 that has some parts of C++0x implemented (note that VC10 will not have the full set of C++0x changes implemented even when VC10 is released):

http://www.microsoft.com/downloads/details.aspx?FamilyId=922B4655-93D0-4476-BDA4-94CF5F8D4814&displaylang=en

Some details on what's new in the VC10 CTP:

As noted in the above article, "The Visual C++ compiler in the Microsoft Visual Studio 2010 September Community Technology Preview (CTP) contains support for four C++0x language features, namely:"

  • lambdas,
  • auto,
  • static_assert,
  • rvalue references
查看更多
梦寄多情
5楼-- · 2018-12-31 22:26

MSVC support for C is unfortunately very lacking. It only supports the portion of C99 that is a subset of C++... which means that, for example, it is physically impossible to compile ffmpeg or its libav* libraries in MSVC, because they use many C99 features such as named struct elements. This is made worse by the fact that libavcodec also requires a compiler that maintains stack alignment, which MSVC doesn't.

I work on x264, which unlike ffmpeg does make an effort to support MSVC, though doing so has often been a nightmare in and of itself. It doesn't maintain stack alignment even if you explicitly pass the highest function call through an explicit assembly-based stack alignment function, so all functions that require an aligned stack have to be disabled. Its also been very annoying that I cannot use vararrays either; perhaps this is for the best, since apparently GCC massively pessimizes them performance-wise.

查看更多
十年一品温如言
6楼-- · 2018-12-31 22:34

I've been involved in the ISO C++ work (2000-2005), and Microsoft made significant contributions to that language. There's no doubt they will work on C++0x, but they'll need a bit more time than say Intel. Micosoft has to deal with a larger codebase that often uses their proprietary extensions. This simply makes for a longer testfase. Yet, they will support most of C++0x eventually (export still isn't loved though, or so I understand).

When it comes to ISO C, the people working on standard are not representative for Microsofts market. Microsofts customers can use C++98 if they're just looking for a better C. So why would Microsoft spend money on C99? Sure, Microsoft cherry-picked parts, but that's sane business. They'd need those for C++0x anyway, so why wait?

查看更多
梦该遗忘
7楼-- · 2018-12-31 22:36

Visual C++ 2008 SP1 contains parts of TR1 at least, and from time to time, the Visual C++ team is blogging or talking about C++0x, so I guess they will support it at some time in the feature. I didn't read anything official though.

查看更多
登录 后发表回答