Skip to content

[func.wrap.ref.class] Use ArgTypes instead of Args#8219

Closed
hewillk wants to merge 2 commits into
cplusplus:mainfrom
hewillk:main-args
Closed

[func.wrap.ref.class] Use ArgTypes instead of Args#8219
hewillk wants to merge 2 commits into
cplusplus:mainfrom
hewillk:main-args

Conversation

@hewillk

@hewillk hewillk commented Sep 10, 2025

Copy link
Copy Markdown
Contributor

Use ArgTypes instead of Args to match the current class signature.
Also, R (*thunk-ptr)(BoundEntityType, Args&&...) should be ArgTypes... since there is no Args....

@tkoeppe tkoeppe requested a review from jwakely October 31, 2025 14:38

@jwakely jwakely left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The first change (in the class synopsis) is required, that's a wording bug.

The other changes aren't strictly necessary, because we're talking about some class function_ref<R(Args...) cx noexcept(noex)> for some set of template arguments We're not referring to the same ArgTypes as declared in the template-head of the class synopsis. As long as the rest of the paragraph is consistent with the start of p1, it's fine.

But the change seems fine anyway, it certainly does no harm.

@tkoeppe

tkoeppe commented Oct 31, 2025

Copy link
Copy Markdown
Contributor

I'd mildly prefer the simpler change in that case to only fix the thing that's broken. We don't need the additional verbosity.

@hewillk

hewillk commented Oct 31, 2025

Copy link
Copy Markdown
Contributor Author

I'd mildly prefer the simpler change in that case to only fix the thing that's broken. We don't need the additional verbosity.

I don't think this is verbosity; I think it's an enhancement. Because it matches the exact signature of the function, which I did intentionally.

Other places in [func.wrap] named Args... are template parameters for constructing internal callable objects, not template parameters for operator().

The function, copyable_function, move_only_function, and function_ref all consistently use the template name ArgTypes....

@eisenwave eisenwave added the P1-Important Misapplication of paper, malformed code, internal inconsistencies label Nov 6, 2025
Comment thread source/utilities.tex
an object \exposid{bound-entity}.
\exposid{bound-entity} has
an unspecified trivially copyable type \exposid{BoundEntityType}, that
an unspecified trivially copyable type \linebreak{} \exposid{BoundEntityType}, that

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

By the way, please don't add forced line breaks like this.

Suggested change
an unspecified trivially copyable type \linebreak{} \exposid{BoundEntityType}, that
an unspecified trivially copyable type \exposid{Bound\-Entity\-Type}, that

... would presumably work, assuming you were coping with overful hboxes due to BoundEntityType going off the side of the page.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let me at least split off the bug fix from the discretionary tweaks then.

@tkoeppe tkoeppe added P2-Bug Presentational errors and omissions and removed P1-Important Misapplication of paper, malformed code, internal inconsistencies labels Nov 7, 2025
Comment thread source/utilities.tex
\tcode{\placeholder{call-args}} is an argument pack with elements such that
\tcode{decltype((\placeholder{call-args}\linebreak{}))...} denote
\tcode{Args\&\&...} respectively.
\tcode{ArgTypes\&\&...} respectively.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@jwakely: this change is a bug fix, too, right? Here we're again referring to the class template synopsis.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ah yes, that's right

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

@tkoeppe

tkoeppe commented Nov 7, 2025

Copy link
Copy Markdown
Contributor

I don't think this is verbosity; I think it's an enhancement. Because it matches the exact signature of the function, which I did intentionally.

One could also see this the other way round in that reusing the name for a local use in a new construct "shadows" the name from the ambient context... I'm tempted to just leave that as is.

The bug fixes were of course very important; thank you for reporting!

@tkoeppe tkoeppe closed this Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2-Bug Presentational errors and omissions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants