In C++ you are only allowed to have one definition in a given named scope. If there are multiple translation units, you are still only allowed to have one definition but the compiler won't guarantee that all definitions are, indeed, identical. That is, if you need a local type, e.g., a struct or a class you need to make sure that the definition does not conflict with another type anywhere in any other translation unit. Doing this is pretty much impossible in a large project unless you have a way to somehow locally protect your type. This is what an unnamed namespace provides: any name defined within an unnamed namespace is unique within the entire executable.