I found this line of a code in a class which I have to modify:
::Configuration * tmpCo = m_configurationDB;//pointer to current db
and I don't know what exactly means the double colon prepended to the class name. Without that I would read: declaration of tmpCo
as a pointer to an object of the class Configuration
... but the prepended double colon confuses me.
I also found:
typedef ::config::set ConfigSet;
This ensures that resolution occurs from the global namespace, instead of starting at the namespace you're currently in. For instance, if you had two different classes called
Configuration
as such:Basically, it allows you to traverse up to the global namespace since your name might get clobbered by a new definition inside another namespace, in this case
MyApp
.::
is used to link something ( a variable, a function, a class, a typedef etc...) to a namespace, or to a class.if there is no left hand side before
::
, then it underlines the fact you are using the global namespace.e.g.:
::doMyGlobalFunction();