Skip to content
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

Do *not* export namespace detail #2288

Merged
merged 1 commit into from May 15, 2021

Conversation

DanielaE
Copy link
Contributor

No description provided.

Comment on lines 459 to 460
FMT_MODULE_EXPORT_END
namespace detail {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest adding FMT_BEGIN_DETAIL_NAMESPACE / FMT_END_DETAIL_NAMESPACE macros to avoid repeating this sequence throughout the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I will apply this suggestion in all of fmt/include where applicable.

Introduce `FMT_BEGIN_DETAIL_NAMESPACE` and `FMT_END_DETAIL_NAMESPACE` for `namespace detail` sections embedded in that part of the code that contains all declarations that are exported from the module, i.e. which is enclosed by `FMT_MODULE_EXPORT_BEGIN` and `FMT_MODULE_EXPORT_END`. Given a correct implementation of C++20 modules, neither the name `fmt::detail` nor any of its contents will become visible outside of the module.
@DanielaE DanielaE force-pushed the fix/exported-detail-namespace branch from e7885e1 to f983677 Compare May 15, 2021 17:04
@DanielaE
Copy link
Contributor Author

All headers included in the module have at most one single export { ... } group now which may have embedded not-exported namespace detail { ... } sections. Only those are affected by the newly introduced macros.

@vitaut vitaut merged commit 5466373 into fmtlib:master May 15, 2021
@vitaut
Copy link
Contributor

vitaut commented May 15, 2021

Thank you!

@DanielaE DanielaE deleted the fix/exported-detail-namespace branch May 16, 2021 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants