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
[algorithms] Long and unwieldly declarations #2518
Comments
Since the requires-clause is subordinate (in a way) to the template-head, maybe we can indent the requires-clause with two more spaces. |
FWIW, that is the formatting that we used for template declarations with requires-clauses in the Ranges TS, primarily because it allows adding requires-clauses to a pre-existing declaration without reflowing the rest of the declaration. It's minimally intrusive, in that sense. I think adding blank lines between the declarations of the range algorithm overloads would help readability more. |
It would be a radical (and controversial) change, but I have found consistently using late-specified return types, even when not syntactically required, gives a much more consistent layout. In particular, the function name, arguably the single most important part of a declaration, is in a much more predictable place. This was less of an issue before return types started being mini-programs in the type system using concepts. |
Editorial meeting: Looks good as-is. |
With the addition of the ranges proposal, we now have even longer declarations in [algorithms], with multiple levels of indentation for template parameters and requires-clauses, plus return types mixed in between. This makes it hard to discern the vital parts, e.g. the declarator-id.
The text was updated successfully, but these errors were encountered: