Document code-emitting function-like macros - #6401
ABWI-Y (ABWI-Y) wants to merge 4 commits into
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Documents legacy code-emitting macros in <type_traits>.
Changes:
- Explains calling-convention and qualifier expansion macros.
- Records legacy usage guidance and rationale.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // New code should not use these macros. They are kept only for existing | ||
| // specializations. (See GH #2279 for rationale.) |
|
|
||
| // _NON_MEMBER_CALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT) | ||
| // Emits FUNC for every supported non-member calling convention. | ||
| // Used to generate free-function specializations (e.g., std::function::operator()). |
| // Used to define internal wrapper classes (e.g., in std::function) | ||
| // that vary by qualifier. | ||
| // | ||
| // This macro exists only for legacy specializations. New components | ||
| // (e.g., move_only_function) intentionally do not provide such coverage. |
| // noexcept: (none) and noexcept, yielding 24 specializations; otherwise 12. | ||
| // Used by std::function, ptr_fun, and type traits to generate overloads | ||
| // that vary by calling convention. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
stl/inc/type_traits:447
- This family-level description only documents
_MEMBER_CALL;_MEMBER_CALL_CV,_MEMBER_CALL_CV_REF, and_MEMBER_CALL_CV_REF_NOEXCEPTremain unexplained even though documenting the code-emitting macros and their usage is the purpose of this change. Please mirror the non-member family’s qualifier-expansion comments and identify the final macro’s_Is_memfunptruse.
// Member calling convention family
// Same as _NON_MEMBER_CALL but also emits __thiscall on x86.
This part should be the PR title. |
Thanks for pointing that out! I've updated the PR title accordingly. |
|
You updated the PR description, not the PR title. |
|
Oh,I'm sorry,I have updated it. |
|
Are there any other issues or feedback that need to be addressed? If not, could you please help merge this? Thanks! |
<type_traits>: Document code-emitting function-like macros
This PR adds comments to document the code-emitting macros that used to live in
and now live in <type_traits>. These macros are used to stamp out
specializations for all the different calling conventions, cv/ref qualifiers,
and noexcept variations that we support.
These macros are kept around only for existing uses (see GH #2279 for why).
New code shouldn't rely on them.
Closes #348.