I have a library in a codebase with something like the following:
namespace rat {
...
enum myEnum {
BLUE,
RED
}
...
} //namespace rat
later on I try to compile an app in the codebase using the library before and it warns me of an ambiguity when i use namespace rat (the codebase main namespace) saying that BLUE could either be rat::myEnum rat::BLUE or rat::enums::Freq rat::enums::BLUE from some other file I’m not familiar with (and isn’t mine) that has an enum Freq with a guy called BLUE in namespace enums within namespace rat…
Is there a way in the user code to say which one I want at the moment? Or do i have to nest mylibs enum in say namespace mylib and then say either rat::enums::BLUE or rat::mylib::BLUE ?
The full unambiguous name of the enum constants will be
::rat::BLUE,::rat::enums::BLUE, etc.Remember that the
::at the beginning of the expression stands for the global namespace.