Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Approaches to reducing what is exported from modules

Open
#1,581 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Quiet
Tech stack
cpp
Domain
compilers

Research direction

Start by examining how C++/WinRT currently emits declarations inside export blocks. Compare the STL approach of marking declarations individually with the libc++ approach of exporting using-declarations, then determine which direction the project wants. Done means a chosen, maintainable export strategy is implemented consistently, but the issue does not identify files or tests.

Written by the indexing model from the issue text.

Description

Currently, C++/WinRT uses a crude approach to exporting declarations: it exports all declarations within an export block. This is permitted by the standard because the standard does not wish to force implementers to distinguish every individual declaration for export. At present, I see two directions for improving this. One is the approach used by the STL, which marks each declaration that needs to be exported with export. The other is the approach used by libc++, which redeclare the declarations to be exported as using-declarations and export them. The advantage of the former is that it more closely resembles a library designed with modules from the very beginning, but the downside is that different overloads must be marked individually. The advantage of the latter is that different overloads can be exported with a single declaration, and it yields a cleaner Git history; the disadvantage is that the export list must be maintained manually. I believe both approaches are good options.

Dominant language
C++
Stars
1.9k
Forks
281
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/cppwinrt

All issues in microsoft/cppwinrt

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.