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

C++: Unclear wording around using-directive #844

Open
mcejp opened this issue Jul 25, 2024 · 1 comment
Open

C++: Unclear wording around using-directive #844

mcejp opened this issue Jul 25, 2024 · 1 comment
Labels
lang:cpp The C++ language

Comments

@mcejp
Copy link

mcejp commented Jul 25, 2024

In the Namespaces section:

With few exceptions, place code in a namespace. Namespaces should have unique names based on the project name, and possibly its path. Do not use using-directives (e.g., using namespace foo). Do not use inline namespaces. For unnamed namespaces, see Internal Linkage.

This wording gives the impression that the using keyword should never be used. However, that would be in direct conflict with an example given later in the section (using ::foo::Bar;). This comment by @tituswinters provides a possible explanation, suggesting it is just a bit of unusual terminology:

Using directives are of the form "using namespace blah;"
Using declarations are of the form "using myproject::some_symbol;"

I think the wording could be made more clear, for example Do not use <i>using namespace</i> directives, if that is the intended meaning.

@ArvindReddySheelam
Copy link

ArvindReddySheelam commented Jul 28, 2024

Hey ! Hi @tonyruscoe I made a pull request(#845) on this issue with a branch name "clarifying namespace using" Could you please once review it and provide me with feedback or any improvements that need to be done?

@vapier vapier added the lang:cpp The C++ language label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang:cpp The C++ language
Projects
None yet
Development

No branches or pull requests

3 participants