isocpp / isocpp/CppCoreGuidelines

Should SF.7 be less specific on how the namespace is modified, ban other mutations in .h files?

Open
#1,658 4 comments 1 reaction 1 assignee View on GitHub

@GabrielDosReis is already working on this.

Since Sep 3, 2020.

Dominant language
CSS
Stars
45.3k
Forks
5.6k
PR merge metrics
No merged PRs in 30d

Description

SF.7: Don't write using namespace at global scope in a header file

the global namespace can be modified as follows

// foo.h
namespace foo {
    using namespace bar;
}

I've assume this rule intends to ban namespace mutations (other than straight additions), but but as written allows this. Should this be disallowed?

I suspect this was written to allow use of namespace aliases in functions scopes but missed this case.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.