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
Indentation in the presence of requires-clauses #5046
Comments
The main amount of review work seems to be in ranges.tex and concepts.tex. |
We say
in our guidelines, so we always indent declarations (including class template declarations), but we don't indent class template definitions. Your first example is thus wrong:
|
Ah yes, indeed. Bad example then, but I think we have analogous violations for class template definitions. |
Editorial meeting observations:
Another alternative: indent requires-by four spaces:
We should also check how function definitions would look. |
Tangential note on braces: Either full braces or no braces, the latter only when both arms fit on a single line (not: statement). |
Tangential note on late requires clauses of function definitions: Indent by two, like the function body:
|
Editorial meeting consensus:
|
We are inconsistent in how we indent subsequent lines when requires-clauses are present. We should update the wiki to include requires-clauses, and fix the indentation where needed.
Recall the established conventions:
Class templates do not indent after the template head:
Function templates are indented after the template head:
Now enter requires-clauses. We seem to be pretty consistent in indenting the requires-clause itself. So I propose to mix that in as follows:
For class templates, the class key itself is unindented, even though there's intervening indentation for the requires-clause:
For function templates, the function is indented by one more level:
An alternative would be to not add extra indentation to function templates (so everything below the template head would just be indented by one level), but we generally seem to like increasing indentation depth for function templates.
Thoughts?
The text was updated successfully, but these errors were encountered: