C ++标准的核心语言规范中的注释和示例是否是非规范的? [英] Are notes and examples in the core language specification of the C++ Standard non-normative?

查看:156
本文介绍了C ++标准的核心语言规范中的注释和示例是否是非规范的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常在SO(和其他地方),我已经看到了C ++标准中的注释和示例不是规范性的声明 - 我可能已经做了这个声明了几次。



但是,我在C ++标准的核心语言规范中找不到这个事实的证据(目前我在查看n3979 C ++ 14工作草案)。

我可以找到的最接近的报价是在第17.5.1.2/2节:



但是,除非我错误地认为该段落仅适用于图书馆部分(即第18至30条和附件D)。



因此问题: C ++标准中的示例非规范?脚注如何?

解决方案

请参阅 ISO / IEC指令第2部分



对于注释和示例:


$ b注释,示例和脚注都被认为是信息性 $ b


整合在文档文本中的注释和示例仅用于提供
用于帮助理解或使用文档的附加信息。它们不应包括要求(应;见3.3.1和表H.1)或任何认为为了使用该文件必不可少的任何资料,例如:b。指令(命令;见表H.1),
建议(应;见3.3.2和表H.2)或许可(可;见表H.3)。
注释可以写成事实陈述。


脚注:


文本给出附加信息;它们的使用应保持最小。作为
,在文本(见6.5.1)脚注中集成的笔记和示例的情况不应包含
要求或认为对于使用该文档不可或缺的任何信息。


但是,请注意,图表和脚本的脚注可以包含需求。


Often on SO (and elsewhere) I have seen the claim that notes and examples in the C++ Standard are not normative - I have probably made this claim myself a few times.

However, I could not find evidence of this fact in the core language specification of the C++ Standard (at the moment I am looking at the n3979 Working Draft for C++14).

The closest quote I could find is in paragraph 17.5.1.2/2:

Paragraphs labeled "Note(s):" or "Example(s):" are informative, other paragraphs are normative.

However, unless I'm mistaken that paragraph only applies to the Library part (i.e. Clauses 18 through 30 and Annex D).

Hence the question: Are all notes and examples in the C++ Standard non-normative? How about footnotes?

解决方案

See §6.5 of the ISO/IEC Directives Part 2. Notes, examples, and footnotes are all considered "informational", as opposed to "normative".

For notes and examples:

Notes and examples integrated in the text of a document shall only be used for giving additional information intended to assist the understanding or use of the document. They shall not contain requirements ("shall"; see 3.3.1 and Table H.1) or any information considered indispensable for the use of the document, e.g. instructions (imperative; see Table H.1), recommendations ("should"; see 3.3.2 and Table H.2) or permission ("may"; see Table H.3). Notes may be written as a statement of fact.

For footnotes:

Footnotes to the text give additional information; their use shall be kept to a minimum. As is the case for notes and examples integrated in the text (see 6.5.1) footnotes shall not contain requirements or any information considered indispensable for the use of the document.

However, note that footnotes to figures and tables can contain requirements.

这篇关于C ++标准的核心语言规范中的注释和示例是否是非规范的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆