Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lib] Canonicalize order of library descriptive elements. #4067

Merged
merged 1 commit into from Jul 21, 2020

Conversation

jensmaurer
Copy link
Member

Partially addresses #3677

(There are 6 remaining mis-orderings that need more attention.)

@JohelEGP
Copy link
Contributor

JohelEGP commented Jul 3, 2020

What are those 6 remaining cases? I remember @zygoloid mentioning some that needed LWG attention because their order may have been intended and reordering the elements could change the interpretation of the content being described.

@jensmaurer
Copy link
Member Author

jensmaurer commented Jul 3, 2020

Remaining cases:

iostreams.tex:3703-3794: bad element ordering: returns remarks effects
iostreams.tex:3836-3898: bad element ordering: remarks returns ensures
iostreams.tex:3932-4032: bad element ordering: effects remarks expects returns
locales.tex:1976-2088: bad element ordering: expects effects remarks returns
numerics.tex:4427-4477: bad element ordering: complexity effects returns throws
regex.tex:1600-1620: bad element ordering: returns effects ensures throws

@JohelEGP
Copy link
Contributor

JohelEGP commented Jul 3, 2020

I remember @zygoloid mentioning some that needed LWG attention because their order may have been intended and reordering the elements could change the interpretation of the content being described.

Maybe I actually meant this comment by @jensmaurer: #2209 (comment). I'm still looking for it, just in case.

@jensmaurer
Copy link
Member Author

This particular concern has been addressed by the "mandating" papers.

@timsong-cpp
Copy link
Contributor

See thread starting at https://lists.isocpp.org/lib/2020/02/15447.php.

Comment on lines 6325 to 6322
\pnum
\expects
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really an order correction, but a merge. Shouldn't it become a list? This is how it looks like (single paragraph number, multiple grammatical paragraphs, treating the two different matters being merged):
1593821626

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar changes in this PR didn't dropped the \expects and not the \pnum, so perhaps that would do here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

would exceed \tcode{max_size()} (see below), or
\item any exceptions thrown by \tcode{allocator_traits<Allocator>::allocate}.
\end{itemize}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

\begin{itemize}
\item \tcode{out_of_range} if \tcode{pos1 > size()},
\item \tcode{length_error} if the length of the resulting string
would exceed \tcode{max_size()} (see below), or
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

max_size() is defined above, so maybe the "see below" refers to the now above Effects: for when the length would exceed max_size(), which should be redundant given [string.require]p1.

Suggested change
would exceed \tcode{max_size()} (see below), or
would exceed \tcode{max_size()} (see above), or
Suggested change
would exceed \tcode{max_size()} (see below), or
would exceed \tcode{max_size()}, or

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed (second option)

\begin{itemize}
\item \tcode{out_of_range} if \tcode{pos1 > size()},
\item \tcode{length_error} if the length of the resulting string
would exceed \tcode{max_size()} (see below), or
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Comment on lines -2240 to -2245
\expects
If an implementation has strict pointer safety\iref{basic.stc.dynamic.safety}
then \tcode{ptr} is a safely-derived pointer.

\pnum
\expects
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be a good idea to deindent the elements a little? Although it might not be worth it considering there aren't many examples like these:
1593825063

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we do both styles. @jwakely , any opinion here?

source/utilities.tex Outdated Show resolved Hide resolved
@jensmaurer jensmaurer force-pushed the reorder branch 2 times, most recently from 3b4ca85 to 32ddb62 Compare July 4, 2020 07:23
@jensmaurer
Copy link
Member Author

@timsong-cpp , I've removed the reordering of the two mandates/constraints pairs that are the subject of the references reflector thread.

@JohelEGP
Copy link
Contributor

JohelEGP commented Jul 4, 2020

I remember @zygoloid mentioning some that needed LWG attention because their order may have been intended and reordering the elements could change the interpretation of the content being described.

Maybe I actually meant this comment by @jensmaurer: #2209 (comment). I'm still looking for it, just in case.

Ah, that reminds me where it was: #3788 (comment).

source/utilities.tex Outdated Show resolved Hide resolved
@jensmaurer
Copy link
Member Author

After the reversions, the remaining ordering violations are:

iostreams.tex:3703-3794: bad element ordering: returns remarks effects
iostreams.tex:3836-3898: bad element ordering: remarks returns ensures
iostreams.tex:3932-4032: bad element ordering: effects remarks expects returns
locales.tex:1976-2088: bad element ordering: expects effects remarks returns
numerics.tex:4427-4477: bad element ordering: complexity effects returns throws
regex.tex:1600-1620: bad element ordering: returns effects ensures throws
utilities.tex:1940-1985: bad element ordering: expects remarks returns
utilities.tex:4631-4664: bad element ordering: mandates constraints effects ensures returns throws remarks
utilities.tex:4672-4705: bad element ordering: mandates constraints effects ensures returns throws remarks
utilities.tex:9807-9851: bad element ordering: mandates constraints expects effects ensures throws

@jensmaurer jensmaurer merged commit a0d7276 into cplusplus:master Jul 21, 2020
@jensmaurer jensmaurer deleted the reorder branch July 21, 2020 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants