問題描述
我一直在閱讀有關(guān) C99 和 C++11 以及所有這些正在添加到語言標(biāo)準(zhǔn)中的非常棒的東西,這些東西有一天可能會很好用.然而,我們目前在 Visual Studio 中編寫 C++ 的土地上苦苦掙扎.
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.
標(biāo)準(zhǔn)中的任何新內(nèi)容是否會被添加到 Visual Studio 中,或者微軟是否對添加新的 C# 變體更感興趣?
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?
除了已接受的答案,我還找到了 Visual C++ 團隊博客:
In addition to the accepted answer, I found the Visual C++ team blog:
http://blogs.msdn.com/vcblog/
特別是其中的這篇文章:
And specifically, this post in it:
https://web.archive.org/web/20190109064523/https://blogs.msdn.microsoft.com/vcblog/2008/02/22/tr1-slide-decks/
非常有用.謝謝!
推薦答案
MS 對此有一系列公開回復(fù),其中大多數(shù)都指責(zé)他們的用戶.喜歡這個:
MS has a series of public replies to this, most of them blaming their users. Like this one:
https://devblogs.microsoft.com/cppblog/iso-c-標(biāo)準(zhǔn)更新/
現(xiàn)在,Visual C++ 編譯器團隊偶爾會收到關(guān)于為什么我們沒有實現(xiàn) C99 的問題.這實際上是基于我們用戶的興趣.當(dāng)我們收到許多對某些 C99 功能的請求時,我們已經(jīng)嘗試實現(xiàn)它們(或類似物).幾個例子是可變參數(shù)宏、long long
、__pragma
、__FUNCTION__
和 __restrict
.如果您發(fā)現(xiàn)其他 C99 功能對您的工作有用,請告訴我們!我們的 C 用戶很少聽到我們的聲音,所以說出來,讓自己聽到
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
嗨:不幸的是,我們從大多數(shù)用戶那里得到的壓倒性反饋是,他們更愿意我們專注于 C++-0x 而不是 C-99.我們有櫻桃采摘"某些流行的 C-99 特性(可變參數(shù)宏,long long
),但除此之外,我們不太可能在 C-99 領(lǐng)域做更多的事情(至少在短期內(nèi)).
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).
喬納森洞穴
Visual C++ 編譯器團隊.
Visual C++ Compiler Team.
這是一個非常可悲的狀態(tài),但如果您懷疑 MS 想要鎖定用戶,這也是有道理的:這使得將現(xiàn)代基于 gcc 的代碼移植到 MSVC 中變得非常困難,至少我覺得這非常痛苦.
This is a pretty sad state of affairs, but also makes sense if you suspect MS wants to lock users in: it makes it very hard to port modern gcc-based code into MSVC, which at least I find extremely painful.
不過,存在一種解決方法:請注意,英特爾在這方面更加開明.英特爾 C 編譯器可以處理 C99 代碼,甚至具有與 gcc 相同的標(biāo)志,從而更容易在平臺之間移植代碼.此外,英特爾編譯器在 Visual Studio 中工作.因此,通過廢棄 MS 編譯器,您仍然可以使用您認(rèn)為具有某種價值的 MS IDE,并盡情使用 C99.
A workaround exists, though: Note that Intel is much more enlightened on this. the Intel C compiler can handle C99 code and even has the same flags as gcc, making it much easier to port code between platforms. Also, the Intel compiler works in visual studio. So by scrapping MS COMPILER you can still use the MS IDE that you seem to think has some kind of value, and use C99 to your hearts content.
老實說,更明智的方法是轉(zhuǎn)移到 Intel CC 或 gcc,并在您的編程環(huán)境中使用 Eclipse.根據(jù)我的經(jīng)驗,代碼在 Windows-Linux-Solaris-AIX 等之間的可移植性通常很重要,不幸的是,MS 工具根本不支持這一點.
A more sensible approach is honestly to move over to Intel CC or gcc, and use Eclipse for your programming environment. Portability of code across Windows-Linux-Solaris-AIX-etc is usually important in my experience, and that is not at all supported by MS tools, unfortunately.
這篇關(guān)于Visual Studio 是否支持新的 C/C++ 標(biāo)準(zhǔn)?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!