3 ms·
While I agree with the general point of using best practices in code samples, the Cpp Core Guidelines actually encourage[0] using using namespace std; for s
by nemetroid 7y ago
While I agree with the general point of using best practices in code samples, the Cpp Core Guidelines actually encourage[0] using
using namespace std;
for std specifically, giving the reasoning that:
> sometimes a namespace is so fundamental and prevalent in a code base, that consistent qualification would be verbose and distracting.
I also work mainly in C++, and personally I prefer using it, together with -Wshadow to catch possible issues.
0: https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#sf6-use-using-namespace-directives-for-transition-for-foundation-libraries-such-as-std-or-within-a-local-scope-only https://github.com/isocpp/CppCoreGuidelines/blob/master/CppC...
- jhasse 7y agoProblems arise when you upgrade your compiler and a new symbol was added to std::