In my project I have to use a library whose symbols are not in a namespace. The library's classes have fairly short and generic names such as Logger
and Reader
. I also use some of these names in my project's own classes.
Consider the situation where my project's symbols are also not namespaced. The name conflict could be resolved by putting my code in a namespace and distinguishing by using qualified names (e.g. ::Logger
and My::Logger
), but I would prefer the library's symbols to be namespaced as well. Is there any way that I can "force" the library's symbols into a namespace of my choosing?
Second, what if I wanted to use two different libraries which both defined a non-namespaced Logger
. Is there any way of avoid a namespace conflict in this case?