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.iota, range.adaptors] View's synopses missing cross-references to iterator and sentinel members #2716

Closed
JohelEGP opened this issue Feb 28, 2019 · 7 comments
Assignees

Comments

@JohelEGP
Copy link
Contributor

Per #2475 (comment), these are bugs.

@jensmaurer
Copy link
Member

Ah, this maybe points at a larger issue: We have private "struct iterator" and "struct sentinel" for exposition only. Are these names part of the interface, or not? If they're not part of the interface, we should use non-C++ names and \placeholder for them, cf. node-handle. Also, once we do that, we can remove "private".
@CaseyCarter, what's the deal here?

@CaseyCarter
Copy link
Contributor

Those names are not part of the interface. The library does not \placeholder the names of exposition-only variables, types, or functions declared as private class members. I'm mildly opposed to such a change: I'm not concerned that users will be confused into thinking they can name things declared private, and I think too much variation in typography makes the spec harder to read.

node-handle and pre-P1252 ref-view are special cases, in that we need to specify them despite that they are not declared anywhere.

@jensmaurer
Copy link
Member

jensmaurer commented Mar 9, 2019

@CaseyCarter: Private members are not as invisible as we might want them to be. Consider:

class Lib_X {
private:
  int x;
};

// user code starts here
int x;
struct User_T : Lib_X {
  int f() { return x; }   // finds Lib_X::x (ill-formed), not the user-written (and likely intended) ::x.
};

So, it's a material part of the class' interface whether there is a name "iterator" declared in the standard library class (even if private).
Is it intended that there is such a name, or not?

@jwakely
Copy link
Member

jwakely commented Mar 9, 2019

But the comment exposition only means they are not part of the specified interface, not even as private members, at least that's what [expos.only.types] is supposed to mean.

@jwakely
Copy link
Member

jwakely commented Mar 9, 2019

Since the implementation won't actually use the names iterator and sentinel, but rather reserved names like __sentinel, the problem Jens describes won't happen. Users won't be referring to any non-members with those reserved names, so it doesn't matter that they are visible and inaccessible.

I don't see any issue here.

@jensmaurer jensmaurer self-assigned this Mar 9, 2019
@jensmaurer
Copy link
Member

But for concepts, we mark them with \expos and we make them italics to shy away people from thinking those names mean anything in their programs. Why are we inconsistent for member types?

@JohelEGP
Copy link
Contributor Author

JohelEGP commented Mar 9, 2019

I think that \placeholder was introduced to emphasize the exposition only nature of names in an accessible scope. Data members being private, \expos should be enough.

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

4 participants