Hands-On Embedded Programming with C++17
上QQ阅读APP看书,第一时间看更新

Namespaces

Namespaces are a way to introduce additional levels of scope into an application. As we saw in the earlier section on classes, these are a compiler-level concept.

The main use lies in modularizing code, dividing it into logical segments in cases where classes are not the most obvious solution, or where you want to explicitly sort classes into a particular category using a namespace. This way, you can also avoid name and type collisions between similarly named classes, types, and enumerations.