简体   繁体   English

如何删除或更改特定要求的C ++标准修订版?

[英]How do I find the revision of C++ standard, where a specific requirement was removed or changed?

Let me give a concrete example to make it more clear what I exactly mean. 让我举一个具体的例子来说明我的意思。

I have two drafts of C++ standard: N4296 that is quite old now and more recent revision N4750. 我有两个C ++标准草案:N4296现在很老了,最近的修订版N4750。 There are some subsections that I am interested in, eg [unord.hash]. 我感兴趣的是一些小节,例如[unord.hash]。 Version N4296 requires from std::hash to provide two nested types argument_type and result_type , but this requirement no longer present in N4750. 版本N4296要求std::hash提供两种嵌套类型argument_typeresult_type ,但N4750中不再存在此要求。

How can I find the revision, where this requirement was removed and the motivation for it? 如何找到修订版本,删除此要求的动机及其动机?

Another source you can use is cppreference . 您可以使用的另一个来源是cppreference They do a very good job in showing what is different in the different version of the standard. 他们在展示不同版本标准的不同之处方面做得非常出色。 For instance, the std::hash page lists that argument_type and result_type are deprecated in C++17 and removed in C++20. 例如, std::hash页面列出了在C ++ 17中不推荐使用argument_typeresult_type ,在C ++ 20中删除了。 With that information you at least know that the remove happened in a version of the standard between C++17 and C++20, which is lot less versions to look through. 有了这些信息,你至少知道删除发生在C ++ 17和C ++ 20之间的标准版本中,这是很少看的版本。

Additionally, in at least some sections , if there was a defect report there will also be a link to that defect report on the page. 此外,在至少某些部分中 ,如果存在缺陷报告,则还会在页面上显示指向该缺陷报告的链接。

You'll still have to do some hunting, but hopefully this will narrow it down for you. 你仍然需要做一些狩猎,但希望这会缩小你的范围。

This can actually be kind of hard. 这实际上有点难。

Individual revisions 个别修订

First, there's the list of closed core language issues (and the equivalent page for library issues), which gives you a paper reference and some date information. 首先,列出了已关闭的核心语言问题 (以及库问题的等效页面),它为您提供了纸质参考和一些日期信息。

There's the working group's mailings . 工作组的邮件

There's the standard's source whose history can be examined using Git tools and their friends. 标准的源代码 ,可以使用Git工具及其朋友检查其历史记录。 The commit log in theory should be useful — though I recommend noting down the name (eg a word like "N3690" ) of the Final Draft for each standard so that you can recognise it in the tag list. 理论上提交日志应该是有用的 - 尽管我建议记下每个标准的最终草案的名称(例如“N3690”这样的单词),以便您可以在标签列表中识别它。

This is your best bet if you're literally looking for the specific revision where a change was introduced. 如果您真正寻找引入更改的特定修订版,那么这是您最好的选择。

Between standards 标准之间

When trying to determine in which standard the change was introduced, personally I tend to just open up individual standard documents and do my own visual bisection. 在尝试确定引入更改的标准时 ,我个人倾向于打开单独的标准文档并进行自己的视觉分割。 This works well if you know where the feature's wording is located in the standard, and if the wording is mostly compartmentalised in one place, though it can still be time consuming. 如果您知道功能的措辞在标准中的位置,并且措辞主要是在一个地方划分,虽然它仍然很耗时,但这种方法很有效。

For motivations you'll be looking for the original proposal paper. 对于动机,您将寻找原始提案文件。 If you manage to find the draft revision where the change was made, hopefully someone will have cross-referenced the name/ID of the proposal. 如果您设法找到进行更改的修订草案,希望有人会交叉引用提案的名称/ ID。

I also find that Google gives some good results when searching for this if you already have a vague idea of its contents: eg "C++ if declaration definition while for consistent proposal". 我还发现Google在搜索时会给出一些好的结果,如果你已经对它的内容有一个模糊的概念:例如“C ++ if declament definition for while consistent proposal”。

And, if you don't mind non-authoritative sources (which should nonetheless be reliable), there are usually Stack Overflow answers that track changes between C++ standards, with links to the relevant papers. 而且,如果您不介意非权威来源(尽管应该是可靠的),通常会有Stack Overflow答案跟踪C ++标准之间的变化,并附有相关论文的链接。 For example, this answer to "What are the new features in C++17?" 例如, 这个回答“C ++ 17中有哪些新功能?” , which references the changes to std::hash that you mention. ,它引用了你提到的对std::hash的更改。

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

相关问题 在哪里可以找到当前的 C 或 C++ 标准文档? - Where do I find the current C or C++ standard documents? 在哪里可以找到标准的 Visual C++ 头文件? - Where can I find the standard Visual C++ header files? 如何找到在 C++ 中引发异常的位置? - How do I find where an exception was thrown in C++? 一般c++模板的参数要求在哪里? - Where to find requirement on the parameters of a general c++ template? 如何在不使用 C++ 标准库的情况下以特定格式打印相邻列表? - How do I print adjacent list in specific format without using the C++ standard library? 在哪里可以找到C ++标准库中特定功能的源代码? (Visual Studio安装) - Where to find source code for specific function in C++ standard library? (Visual Studio installation) C ++ #include查找有任何标准要求吗? - Is there any standard requirement for C++ #include lookup? 如何在 CMake 中获取 C++ 标准标志作为字符串? - How do I get the C++ standard flag as a string in CMake? 在c ++中,仅在全局范围内允许使用“表达式”来初始化全局对象。 在标准中哪里可以找到? - In c++, `expressions` are allowed in global scope only to initialize global objects. Where can I find this in the Standard? 我可以在C ++标准中找到在全局范围内调用函数的支持吗? - Where in the C++ Standard can I find support for invoking a function in global scope?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM