Stupid C++ namespace tricks

6 years ago
ian $I9xuH7PGU4 4

https://blogs.msdn.microsoft.com/oldnewthing/20180516-00/?p=98765

These tricks may be obvious, but at least I'm going to write them down.

It is common to import an entire namespace into the global namespace. I'm not saying it's a good idea, but it is common. The most notorious example is to put

using namespace std;

to import the std namespace into the global namespace.