Once Upon a Time
In the world of Win32 and COM, there’s little support to organize code in logical units, resulting in a flat application programming interface (API). Although C++ has a notion of namespaces, lots of APIs originate from earlier times when the use of namespaces wasn’t part of the design philosophy for those APIs.
For example, Win32 is basically an API consisting of functions and some data types, with no object-oriented aspirations. All those functions live in a single “namespace,” and therefore it’s perfectly possible to run into situations where two functions with the same name will clash. Such a problem manifests itself at compile time because the compiler (and in C/C++, we should also mention the linker) can’t figure out what ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access