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

[ranges.syn] Make get overloads freestanding #5839

Merged
merged 1 commit into from Sep 16, 2022

Conversation

jwakely
Copy link
Member

@jwakely jwakely commented Sep 15, 2022

These were moved to the synopsis after the P1642 changes to mark nearly everything in the synopsis freestanding, so they were not marked.

Fixes #5837

@jwakely
Copy link
Member Author

jwakely commented Sep 15, 2022

Does the using-declaration to add it to std need the // freestanding comment too?

@JohelEGP
Copy link
Contributor

Does the using-declaration to add it to std need the // freestanding comment too?

This relates to #5724 (comment). The using-declaration is a declaration, which can be a freestanding entity, but the literal instructions was to mark entities and not declarations and macros definitions.

@jwakely
Copy link
Member Author

jwakely commented Sep 15, 2022

But https://cplusplus.github.io/LWG/issue3753 changes that.

@JohelEGP
Copy link
Contributor

It fixes the definition But does not

clarify whether the paper's instructions to the editor that mention "every entity" actually meant "all declarations and macro definitions".

@JohelEGP
Copy link
Contributor

The same #5396 which moved get, also moved memory_order variables which are not marked freestanding. That's consistent with the instructions to mark entities, because a variable is not an entity, but inconsistent with the fact that headers marked "all freestanding" have their variables be freestanding because they are declarations. The paper even instructed to explicitly mark some variables as freestanding.

@jwakely
Copy link
Member Author

jwakely commented Sep 15, 2022

The intention of the paper is pretty obvious, even if the wording was imprecise. Let's not insist on inferior outcomes because of that imprecision. Expect NB comments to ensure everything is freestanding.

My question is not "did the precise wording in P1642R11 say to mark this using-declaration freestanding", it's whether it needs to be or not. I think it does need to be.

@JohelEGP
Copy link
Contributor

Does the using-declaration to add it to std need the // freestanding comment too?

Then yes is the answer I expect it to be.

@jwakely
Copy link
Member Author

jwakely commented Sep 15, 2022

"An entity is a value, object, reference, structured binding, function, enumerator, type, class member, bit-field,
template, template specialization, namespace, or pack."

Those variables are objects, no?

@JohelEGP
Copy link
Contributor

AFAIK, the variables designate objects.

6# A variable is introduced by the declaration of a reference other than a non-static data member or of an object.
The variable's name, if any, denotes the reference or object.

Copy link
Member

@jensmaurer jensmaurer left a comment

Choose a reason for hiding this comment

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

Before this gets out of control: This looks good.

@jwakely , feel free to mark the using-declarations as freestanding, too.

These were moved to the synopsis after the P1642 changes to mark nearly
everything in the synopsis freestanding, so they were not marked.
@jwakely
Copy link
Member Author

jwakely commented Sep 16, 2022

@jwakely , feel free to mark the using-declarations as freestanding, too.

Done.

@tkoeppe tkoeppe merged commit 1383e97 into cplusplus:main Sep 16, 2022
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.

[ranges.syn] std::[ranges::]get([const ]subrange<I, S, K>&) is not marked freestanding
4 participants