Skip to content

using namespace in header files #26

@bradbishop

Description

@bradbishop

git grep 'using namespace' **.hpp

"using namespace" at global scope a header violates the cpp core guidelines:

https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rs-using-directive

"using namespace" in namespace scope is not called out but it is equally frowned upon because unexpected side effects:

foo.hpp:

namespace foo
{
    using namespace std;
};

main.cpp:

#include foo.hpp
using namespace foo; // oops - I have now pulled in namespace std?!?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions