In our team we want to Restrict practice of adding "using namespace" in header at global scope as that is not a good practice and often leads to name collision and namespace pollution.
Is there a way in gcc we can restrict this practice of adding using namespace in header at compile time?
I mean to get some kind of warning when the compiler sees at global scope in header "using namespace".
Thanks
You can use clang-tidy
together with the google build using namespace check, which should complain on these using directives.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With