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

[ios.base] has too many variables called "index" #1955

Closed
jwakely opened this issue Mar 16, 2018 · 2 comments
Closed

[ios.base] has too many variables called "index" #1955

jwakely opened this issue Mar 16, 2018 · 2 comments
Assignees

Comments

@jwakely
Copy link
Member

jwakely commented Mar 16, 2018

The synopsis shows an exposition-only static data member called index but the same name is used for the parameters of iword, pword, register_callback, and redundantly in the event_callback alias declaration.

Then [ios.base.locales] uses index, presumably not referring to the static data member. [ios.base.storage] uses it to refer to the static data member in the definition of xalloc. The definitions of iword and pword use idx, which is inconsistent with the synopsis, but avoids confusion. [ios.base.callback] uses index as a function parameter again, and finally [ios.base.cons] uses it, again not referring to the static data member.

@jwakely
Copy link
Member Author

jwakely commented Mar 16, 2018

The uses of index in [ios.base.locales] and [ios.base.cons] refer to a function parameter of a completely different function, even though that name isn't in scope there, and the static data member index is in scope. How lovely.

@timsong-cpp
Copy link
Contributor

I'd read those uses as declaration of a "local variable" a la
for(auto [fn, index] : registered-pairs) { ... }. Who knew that C++98 had structured bindings? :)

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