Skip to content

Approaches to reducing what is exported from modules #1581

@YexuanXiao

Description

@YexuanXiao

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions