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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docs] [C++20] [Modules] Ideas for transitioning to modules #80687
[docs] [C++20] [Modules] Ideas for transitioning to modules #80687
Changes from all commits
19065e2
d41c828
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would imagine this is generally an anti-goal for most people, or would create maintenance challenges - because if your library is used by other libraries - some of those users might be using C++20 modules, and some might not be. And then if you want to depend on all those libraries together in some other library/program, it'd be unfortunate if you were stuck/not able to do that due to the very opinionated original library that said "only use headers or only use modules, don't mix and match".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I'd like to do this for my library. I feel the idea is somewhat like
private
orfinal
in C++. They make the project to be clean by restricting the usages. I know this is not universally true. For example, fundamental libraries like boost or STL may not be in this.And I feel this may be fine since it is only an idea instead of requiring people to follow. I just want to give a hint to people who want to do this but don't know how.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the motivation for doing this? Given the challenges it presents to downstream usage of the library?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, if the library is in a closed-ended ecosystem (e.g., only available to an organization internally), then we want to provide modules interfaces for the library and we want our users to avoid the accidental performance cost due to mixing use of include and import, then such pattern helps. In case, the user repo A depends on a repo B and repo B include the modularized library, the repo A can reach out repo B to refactor itself. I feel such workflow can be understandable in a close ended organization.
It will bring some burden to users initially, but in the end it would bring better quality. I understand this is not a helpful universally. But I feel it may be helpful to people who want to bring stronger requirement to the usage of their codes.