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

[range.split.outer,range.split.inner] "current" placeholder vs. current_ exposition-only member #3851

Open
jensmaurer opened this issue Mar 10, 2020 · 4 comments
Labels
decision-required A decision of the editorial group (or the Project Editor) is required.

Comments

@jensmaurer
Copy link
Member

Some misuse was fixed in #3849, but having these two near-identical identifiers with different semantics is prone to cause further mix-ups.

Find a better name for one of them.

@jensmaurer jensmaurer added the decision-required A decision of the editorial group (or the Project Editor) is required. label Mar 10, 2020
@JohelEGP
Copy link
Contributor

How about renaming current to effective-current?

@CaseyCarter
Copy link
Contributor

I'd like to avoid anything of the form "xxx-current"/"current-xxx" if we can. Now that all of the private variables have been kebab-cased, it's too easy to confuse the exposition only name foo-bar with an expression that calculates the difference of the two exposition-only names foo and bar.

@JohelEGP
Copy link
Contributor

Ah, right. IIRC, the dash replaced underscores in exposition-only names to make that property more obvious. Now that they're kebab-cased, underscores should once again be viable.

@jwakely
Copy link
Member

jwakely commented Mar 10, 2020

One option would be to define current() as a pair of exposition-only member functions (const and non-const), and we could specify them precisely:

constexpr auto& current() {
 if constexpr (forward_range<Base>)
  return current_;
else
  return parent_.current_;
}

The distinction between current_ and current() still isn't huge, but the parentheses would help.

Or there's always CURRENT in the style of INVOKE, but we've moved away from that to kebab-case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
decision-required A decision of the editorial group (or the Project Editor) is required.
Projects
None yet
Development

No branches or pull requests

4 participants