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
[chrono] Use nested namespace definitions in the library where applicable #4256
Comments
I welcome the general policy. I've started to find nested namespaces rather confusing as we've started having deeper nesting. I've even considered whether we should start applying |
In [algorithms], we have a lot of
Closing namespace std in between would tear apart related non-ranges and ranges algorithms more than they deserve. |
Given the usefulness of the compactness in Richard's proposal is useful where it improves clarity, and in those cases we should feel welcome to use that style. In the algorithms case, the proposal would not improve clarity, and we can retain the status quo. Ultimately, the goal is not some arbitrary consistency with some useless rule, but to make a clear and understandable document. So above all be consistent with "looks good". For now, we will only adjust |
For example, in [chrono.syn] we have:
(Note that
namespace inline literals::inline chrono_literals
is ill-formed: there's no way to collapse two levels of namespace where the outer level is inline.)I wonder if it would be better to express [chrono.syn] as:
In addition to being more compact, this would mean we never have a (subtle)
}
appearing in the middle of the text switching us between namespaces. (In particular, the switch fromstd::chrono
tostd
in the current synopsis is easy to miss, and an incautious reader might think that the inline namespaceliterals
is instd::chrono
, not instd
.)More generally, I think we should consider a policy that we never nest namespace definitions in the library clauses: names in namespace definitions should always be relative to the global namespace.
The text was updated successfully, but these errors were encountered: