Skip to content

Fix doc typo: Updated ..< instead of ... for range operations in doc common.md #1254

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

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

tsoj
Copy link
Contributor

@tsoj tsoj commented Aug 22, 2024

No description provided.

@@ -216,11 +216,11 @@ Postfix notation lets the code read fluidly left-to-right, in the same order in
| `#!cpp --` | `#!cpp iter--` | `#!cpp --iter` |
| `(` `)` | `#!cpp f( 1, 2, 3)` | `#!cpp f( 1, 2, 3)` |
| `[` `]` | `#!cpp vec[123]` | `#!cpp vec[123]` |
| `...` | `#!cpp v.begin()...v.end()` | `#!cpp std::ranges::subrange(v.begin(), v.end())` |
| `..<` | `#!cpp v.begin()..<v.end()` | `#!cpp std::ranges::subrange(v.begin(), v.end())` |
Copy link
Contributor

@gregmarr gregmarr Aug 23, 2024

Choose a reason for hiding this comment

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

@hsutter Should these two range operators be in the binary operators table instead of the unary operators table? Should the ... pack expansion then be in this table, or is it okay as the note below?

Copy link
Owner

Choose a reason for hiding this comment

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

Good point, I'll look at that post-merge

Copy link
Contributor

Choose a reason for hiding this comment

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

@hsutter

Note: The ( ), [ ], ..<, and ..= operators are treated as postfix unary operators, though they can take additional arguments.

I can kinda see how () and [] as pairs are considered postfix since they apply their contents to the thing to the left. Can you explain how ..< and ..= are treated as postfix unary? I don't understand what that means.

@hsutter
Copy link
Owner

hsutter commented Sep 24, 2024

Thanks!

@hsutter hsutter merged commit 6828ff5 into hsutter:main Sep 24, 2024
27 of 29 checks passed
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.

3 participants