mirror of
https://github.com/cpp-best-practices/cppbestpractices.git
synced 2025-12-17 11:14:35 +03:00
Changed "Never use 'using' In a Header File" guideline.
Changed it to "Never use 'using namespace' ...". Also added some more explanation.
This commit is contained in:
@@ -90,9 +90,11 @@ int myFunc()
|
|||||||
|
|
||||||
which would be impossible if the function comment header used `/* */`
|
which would be impossible if the function comment header used `/* */`
|
||||||
|
|
||||||
## Never Use `using` In a Header File
|
## Never Use `using namespace` In a Header File
|
||||||
|
|
||||||
This causes the name space you are `using` to be pulled into the namespace of the header file.
|
This causes the name space you are `using` to be pulled into the namespace of the header file.
|
||||||
|
It litters the own namespace and it may lead to name collisions in the future.
|
||||||
|
Writing `using namespace` in an implementation file is fine though.
|
||||||
|
|
||||||
|
|
||||||
## Include Guards
|
## Include Guards
|
||||||
|
|||||||
Reference in New Issue
Block a user