Document code-emitting function-like macros - #6401
Open
ABWI-Y (ABWI-Y) wants to merge 4 commits into
Open
ABWI-Y (ABWI-Y) wants to merge 4 commits into
ABWI-Y (ABWI-Y) wants to merge 4 commits into
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Contributor
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.
Comment on lines
+387
to
+388
| // 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()). |
Comment on lines
+505
to
+509
| // 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. |
Comment on lines
+458
to
+460
| // 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. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Contributor
Author
|
Are there any other issues or feedback that need to be addressed? If not, could you please help merge this? Thanks! |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
<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.