The ability to declare an entity is governed by the entity's containing declaration space. A declaration space is a collection of entities that allows for unambiguous name resolution. Except in the case of overloaded type members, it is an error for two or more declarations to introduce an entity with the same name into a declaration space. Also, a declaration space may never contain different kinds of entities with the same name. For example, a declaration space can never contain a data member and a method by the same name.
Entities are introduced into a declaration space by either declarations or inheritance. An entity's containing declaration space is called the entity's declaration context. A declaration, in turn, creates a new declaration space to contain the entity declarations (if any) nested within it. Thus, the declarations in a program create a hierarchy of declaration spaces.