Skip to content

Conversation

eisenwave
Copy link
Member

@eisenwave eisenwave commented Sep 10, 2025

The current wording in p1 makes no sense to me. Firstly, it says

An object of optional<T&> ...

cplusplus/papers#1661 says

An instance of optional<T&>

#7979 editorially replaced "instance" with "object" (accidentally? I could not find discussion on this), and now this is grammatically wrong. The wording idiom is

An object of type

The second sentence is also inconsistent with the paper. The paper once again uses the term "instance", but the draft wording just says

When an optional<T&>

This is also incorrect because it's a category error. We use this idiom like "an array" or "a vector" when referring to types, not to objects.

@jwakely
Copy link
Member

jwakely commented Sep 10, 2025

The current wording in p1 makes no sense to me. Firstly, it says

An object of optional<T&> ...

cplusplus/papers#1661 says

An instance of optional<T&>

Where?

#7979 editorially replaced "instance" with "object" (accidentally? I could not find discussion on this), and now this is grammatically wrong.

The paper says "An object"

The second sentence is also inconsistent with the paper.

No it isn't, are you looking at the wrong paper? I think you're looking at an old revision.

The paper once again uses the term "instance", but the draft wording just says

When an optional<T&>

That's what the paper says.

This is also incorrect because it's a category error. We use this idiom like "an array" or "a vector" when referring to types, not to objects.

We use it both ways, e.g. "Effects: Constructs an empty vector, using the specified allocator."

@eisenwave
Copy link
Member Author

eisenwave commented Sep 10, 2025

Hmm yeah, I was in a hurry when I drafted this and looked at the pre-existing wording in https://eel.is/c++draft/optional.optional.general#1, which uses the "instance" term.

The paper was correctly applied, but

An object of optional<T&>

seems bad regardless.

While we're on the subject, it's probably best to remove that weird asymmetry. We shouldn't be talking about "instances" for optional<T> but "objects" for optional<T&>.

If there's precedent, the second "an optional<T&>" seems fine then, but once again, that should be consistent across the wording for the primary template and the partial specialization.

@jwakely
Copy link
Member

jwakely commented Sep 10, 2025

Yes, feel free to include the pre-existing "instance of optional<T>" in this PR.

@eisenwave eisenwave changed the title [optional.optional.ref.general] Use "object of type optional<T&>" correctly [optional.optional.general], [optional.optional.ref.general] Use "object of type optional<T&>" correctly Sep 10, 2025
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.

2 participants