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

[algorithms] Long and unwieldly declarations #2518

Closed
jensmaurer opened this issue Nov 26, 2018 · 4 comments
Closed

[algorithms] Long and unwieldly declarations #2518

jensmaurer opened this issue Nov 26, 2018 · 4 comments

Comments

@jensmaurer
Copy link
Member

jensmaurer commented Nov 26, 2018

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.

decl

@jensmaurer jensmaurer added the decision-required A decision of the editorial group (or the Project Editor) is required. label Nov 26, 2018
@jensmaurer
Copy link
Member Author

Since the requires-clause is subordinate (in a way) to the template-head, maybe we can indent the requires-clause with two more spaces.

@CaseyCarter
Copy link
Contributor

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.

@AlisdairM
Copy link
Contributor

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.

@jensmaurer
Copy link
Member Author

Editorial meeting: Looks good as-is.

@jensmaurer jensmaurer removed the decision-required A decision of the editorial group (or the Project Editor) is required. label Sep 10, 2019
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

No branches or pull requests

3 participants