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
Style of "equivalent to" #1119
Comments
This was discussed earlier this year. I think we agreed that the third form is wrong (we shouldn't use a semi-colon after an expression, only after a statement) but that we do want all three of codeblock/statement/expression. |
It seems we're using "Equivalent to |
Maybe we can settle on these forms: Codeblock-?- Effects: Equivalent to:
where we may optionally explain things used in the block. Inline statement-?- Effects: Equivalent to: Inline expression-?- Effects: Equivalent to -?- Effects: Equivalent to |
Sounds minimally-invasive vs. the status quo. |
I think that's what we agreed to use previously, yes. See also #694 |
OK, I think the detail that was missing from #694 is how to deal with continuing sentences, e.g. when something needs a retrospective definition. My concrete proposal here is to place a comma after an inline statement and never use an inline expression. |
Do you have specific examples? |
@jensmaurer: I realise that's a valid statement, but the idea is to partially specialize on such patterns and prefer "inline |
@jensmaurer: E.g. 20.7.2.4/1. I would add a comma there. 20.7.4/10 is particularly weird. Also 20.14.9/1. |
Some "equivalent to" statements are also just poorly constructed. E.g. 21.3.1.6.2, compare p6 vs p17. I think the latter ("Equivalent to |
@jensmaurer: Please leave this bug open until we have at least updated the style wiki. |
"Equivalent to: |
If I recall correctly, we chose to use "Equivalent to: See https://github.com/cplusplus/draft/wiki/Specification-Style-Guidelines#writing-effects-in-a-function-description for the existing description of the rules here. |
@tkoeppe: That covers it, right? |
@jensmaurer: The wiki is still missing information on how to continue with trailing definitions after the code, and maybe it should include a disambiguation rule for "equivalent to function-call" that I mentioned above. |
I've updated the wiki. |
In the library, we have a term of art "equivalent to" to specify effects. What we don't have is a consistent way of formatting it. Currently observed forms:
statement;
expression;
expression
.statement;
where foo is bar.I think we should definitely have the colon after "to", and we should probably have both a codeblock and an inline form.
The text was updated successfully, but these errors were encountered: