微软 C++语言参考
每当提出任何问题并且需要参考文本时,我都不会看到 MSDN C++ 语言参考 被引用。
我浏览了一下,个人觉得写得非常好。
它没有像标准一样经常使用是否有某些具体原因?
是因为它包含了一些VC++特有的功能吗?
Whenever any question is asked, and a reference text is needed, I never see MSDN C++ Language Reference being referred.
I was browsing through it and I personally feel that it is extremely well written.
Is there some specific reason it is not used as often as a standard?
Is it because it contains some VC++ specific features?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我相信这是因为我们这些引用参考文献的人引用的是实际标准本身。
I believe it's because those of us referencing a reference reference the actual standard itself.
答案相当简单:MSDN 参考资料并不具有权威性。它告诉您 Microsoft 编译器的行为方式,是的,它通常恰好与标准所说的一致。但当有人问 C++ 语言如何处理某些情况时,只有一个文本具有权威:ISO 标准。
因此,在回答有关 C++ 的问题时,人们倾向于参考该标准。
如果您具体询问 MSVC 如何实现它,那么 MSDN 将是一个完全有效的来源。但大多数问题都只是关于 C++。
或者换句话说:如果 MSDN 包含拼写错误,那么 MSDN 就是错误的。如果 ISO 标准包含拼写错误,那么语言就是这样定义的。
The answer is fairly simple: The MSDN reference is not authoritative. It tells you how Microsoft's compiler behaves, and yes, it usually happens to coincide with what the standard says. But when someone asks how the C++ language deals with some situation, only one text has any authority: the ISO standard.
So when answering questions about C++, people tend to reference the standard.
If you ask specifically about how MSVC implements it, then MSDN would be a perfectly valid source. But most questions are simply about C++.
Or to put it another way: if MSDN contains a typo, then MSDN is wrong. If the ISO standard contains a typo, then that's how the language is defined.
MS 非常擅长明确文档的哪些部分是 MS 特定的,因此我同意 MS 参考资料非常好(特别是如果您对 MS 扩展感兴趣的话)。
如果我正在寻找有关“什么是标准”的信息,我通常会参考标准文档,因为:
最大的缺点是我没有 C90 标准的电子版本,然而..
MS has been pretty good about making clear which parts of the document are MS specific or not, so I agree that the MS references are pretty good (particularly if you're interested in MS extensions).
I generally refer to the standards docs if I'm looking for information about "what's standard" because:
The biggest drawback is that I don't have an electronic version of the C90 standard, yet..
是因为它包含了一些VC++特有的功能吗?
我认为这是基本原因。例如,它通常包含有关 C++/CLI 的信息,而不仅仅是C++。
我认为 VC++ 2010 参考在区分哪一部分属于 C++ 本身以及哪一部分属于 C++/CLI 方面非常小心。但要参考标准,当然最好参考标准本身。 VC++ 文档也经常引用该标准。
Is it because it contains some VC++ specific features?
I think that's the basic reason. For example, it often contains info on C++/CLI, not just C++.
VC++ 2010 reference, I think, is careful in distinguishing which part is in the C++ proper and which part is in the C++/CLI. But to refer to the standard, of course it's better to refer to the standard itself. VC++ documentation refers to the standard quite often, too.
一个有趣的例子:看看所有这些 __XXX 关键字!! (C++标准没有)
One interesting example: just look at all those __XXX keywords!! (The C++ standard has none)
C++ 标准定义了 C++ 语言的工作方式,Microsoft C++ 语言参考定义了 Microsoft 对该语言的实现方式的工作方式。
因此,如果您想知道独立于编译器可以保证哪些行为,该标准就是您的指南。一些细节和某些极端情况留待实现定义,每个实现都可以定义语言的扩展,因此如果您想使用这些 MSCV 特定属性,Microsoft 的语言参考应该解释它们。
大多数关于 C++ 的问题都没有明确要求 MSVC 特定的答案,而这对于其他编译器来说可能不正确。因此,参考标准给出了一个通用的、独立于编译器的答案,而 MS 语言参考对于除 MSVC 之外的任何其他内容都没有多大影响。
The C++ Standard defines how the C++ language works, the Microsoft C++ Language Reference defines how Microsoft's implementation of that language works.
So if you want to know what behavior is guaranteed independent of the compiler, The Standard is your guide. Some details and certain corner cases are left to be implementation-defined there and every implementation can define extensions to the language, so if you want to use those MSCV specific properties Microsoft's Language Reference should explain them.
Most SO questions on C++ on don't explicitly ask for a MSVC specific answer that might not be true for other compilers. So referring to The Standard gives an general, compiler independent answer, while the MS Language Reference wouldn't hold much weight for anything else than MSVC.