简体   繁体   English

VS2005、VS2008遵循哪个标准?

[英]Which standard does VS2005, VS2008 follow?

Do they both follow the C++03 released in 2003?它们都遵循 2003 年发布的 C++03 吗?

They both target C++03, yes.他们都以 C++03 为目标,是的。 But they also both have areas where they fail to comply with the standard.但它们也都有不符合标准的地方。 (So does GCC, btw, before any fanboys on either side starts frothing at the mouth). (GCC 也是如此,顺便说一句,在两边的任何粉丝开始在嘴边起泡之前)。

But keep in mind that C++03 is basically a very small bugfix release, nailing down a few "common sense" things that sensible compilers would have done anyway (for example, in C++98, it was, strictly speaking, possible to have vectors that aren't contiguously allocated. C++03 prohibits that, but every sane compiler vendor would have used contiguous vectors anyway , because that's what vectors are intended for)但是请记住,C++03 基本上是一个非常小的错误修复版本,确定了一些明智的编译器无论如何都会做的“常识”事情(例如,在 C++98 中,严格来说,这是可能的拥有不连续分配的向量。C ++ 03 禁止这样做,但每个理智的编译器供应商无论如何都会使用连续向量,因为这就是向量的用途)

GCC doesn't even have a C++03 standard setting. GCC 甚至没有 C++03 标准设置。 You tell it to target C++98 (with std=c++98) , and it actually targets C++03 instead.你告诉它以 C++98 (with std=c++98)为目标,它实际上以 C++03 为目标。 I'm not aware of a compiler which actually makes a distinction between the two, because the changes are so few, and so obvious.我不知道实际上区分两者的编译器,因为变化是如此之少,而且如此明显。

Yes, VS2005 & VS2008 both follow C++03 .是的, VS2005VS2008都遵循C++03 They do support some features of C++0x though but they are not fully C++0x compliant, most probably none of the compilers is at the moment since the final specification is to be published yet.虽然它们确实支持C++0x的一些特性,但它们并不完全符合C++0x ,很可能目前还没有编译器,因为最终规范尚未发布。 GCC povides compliance to C++0x than any other compiler at the moment. GCC目前比任何其他编译器都更符合C++0x

C++0x is not yet released.The final specification is expected to be published sometime in mid-2011. C++0x 尚未发布。最终规范预计将在 2011 年年中的某个时间发布。

You should see this .你应该看到这个

Yes, both of them follow C++03.是的,它们都遵循 C++03。 VS2010 has some C++0x features. VS2010 有一些 C++0x 特性。 The most complete feature support is offered by GCC at the moment.目前GCC提供最完整的功能支持。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM