19

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. There are some subsections that I am interested in, e.g. [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.

How can I find the revision, where this requirement was removed and the motivation for it?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Baykov Nikita
  • 608
  • 4
  • 11
  • 8
    [The C++ draft git repository](https://github.com/cplusplus/draft)? – Some programmer dude Jan 12 '19 at 16:51
  • 1
    Are you asking about which version of the standard did this or which *draft* revision? Because I don't know why the latter would matter to you. – Nicol Bolas Jan 12 '19 at 18:11
  • @NicolBolas, draft revision, because I hoped that it will help me to find the original proposal that explains, why the change was necessary. Let's say that I use the implementation of C++ standard library that does not fulfill certain standard requirements, e.g. hash does not act like unary_function. What consequences it may have? Is it just missing two unnecesary typedef's? How they were intended to be used? Since they are already deprecated, I tend to think that there were some unexpected problems and the proposal could explain them. – Baykov Nikita Jan 13 '19 at 15:19
  • 1
    @user7122617: "*because I hoped that it will help me to find the original proposal that explains, why the change was necessary.*" Finding the specific draft that included a change won't help you find the proposal/defect resolution that suggested it. The drafts won't say why a proposal was accepted or even what the proposal was. If you want to find the original proposal, the best way to do that is to search the [WG21 papers site with a Google site-specific search](http://www.open-std.org/JTC1/SC22/WG21/docs/papers/). – Nicol Bolas Jan 13 '19 at 16:07
  • @NicolBolas, it seems that you are right. I've just found http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0090r0.htm – Baykov Nikita Jan 13 '19 at 16:20

2 Answers2

15

Another source you can use is 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. 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.

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.

NathanOliver
  • 171,901
  • 28
  • 288
  • 402
12

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. The commit log in theory should be useful — though I recommend noting down the name (e.g. a word like "N3690") of the Final Draft for each standard so that you can recognise it in the tag list.

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.

I also find that Google gives some good results when searching for this if you already have a vague idea of its contents: e.g. "C++ if declaration definition while for 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. For example, this answer to "What are the new features in C++17?", which references the changes to std::hash that you mention.

Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055
  • Thank you for your answer. It seems that I found what I was looking for: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0090r0.htm – Baykov Nikita Jan 13 '19 at 16:24