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.
Currently, C++/WinRT uses a crude approach to exporting declarations: it exports all declarations within an
exportblock. This is permitted by the standard because the standard does not wish to force implementers to distinguish every individual declaration forexport. 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 withexport. The other is the approach used by libc++, which redeclare the declarations to be exported as using-declarations andexportthem. 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.