Skip to content

Document code-emitting function-like macros - #6401

Open
ABWI-Y (ABWI-Y) wants to merge 4 commits into
microsoft:mainfrom
ABWI-Y:main
Open

ABWI-Y (ABWI-Y) wants to merge 4 commits into
microsoft:mainfrom
ABWI-Y:main

Conversation

@ABWI-Y

@ABWI-Y ABWI-Y (ABWI-Y) commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

<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.

Copilot AI balanced review requested due to automatic review settings August 9, 2026 10:21
@ABWI-Y
ABWI-Y (ABWI-Y) requested a review from a team as a code owner August 9, 2026 10:21
@github-project-automation github-project-automation Bot moved this to Initial Review in STL Code Reviews Aug 9, 2026
@azure-pipelines

This comment was marked as resolved.

Copilot AI left a comment

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.

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 thread stl/inc/type_traits Outdated
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.)
Comment thread stl/inc/type_traits Outdated

// _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 thread stl/inc/type_traits Outdated
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 thread stl/inc/type_traits Outdated
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.
Copilot AI review requested due to automatic review settings August 9, 2026 10:36

This comment was marked as resolved.

Copilot AI review requested due to automatic review settings August 9, 2026 10:43

This comment was marked as resolved.

Copilot AI review requested due to automatic review settings August 9, 2026 12:31

This comment was marked as resolved.

@frederick-vs-ja

This comment was marked as resolved.

@ABWI-Y

This comment was marked as resolved.

@StephanTLavavej

This comment was marked as resolved.

@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) added the documentation Related to documentation or comments label Aug 15, 2026
@ABWI-Y ABWI-Y (ABWI-Y) changed the title Update comments per code review feedback Document code-emitting function-like macros Aug 15, 2026
@ABWI-Y

This comment was marked as resolved.

@ABWI-Y

Copy link
Copy Markdown
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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Related to documentation or comments

Projects

Status: Initial Review

Development

Successfully merging this pull request may close these issues.

<xstddef>: document code-emitting function-like macros

4 participants